forked from raphaelscholle/OpenHD-imager
-
Notifications
You must be signed in to change notification settings - Fork 4
149 lines (125 loc) · 4.98 KB
/
Windows.yml
File metadata and controls
149 lines (125 loc) · 4.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: OpenHD Image Writer Windows
on:
push:
branches:
- "2.5-evo"
- "dev-release"
- "release"
- "testing"
paths-ignore:
- '**.md'
- '**.asciidoc'
- '**.adoc'
- '.gitignore'
- 'LICENSE'
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: windows-latest
defaults:
run:
working-directory: src
steps:
- uses: actions/checkout@v5
- name: Install Qt
id: qt-install
uses: jurplel/install-qt-action@v4
with:
version: '5.15.2'
aqtversion: '==3.1.*'
host: windows
target: desktop
arch: win32_mingw81
setup-python: false
tools: tools_cmake tools_mingw81,qt.tools.win32_mingw810
- name: Download and Extract OpenSSL
shell: pwsh
working-directory: ${{ github.workspace }}
run: |
Invoke-WebRequest `
-Uri "https://download.firedaemon.com/FireDaemon-OpenSSL/openssl-1.1.1w.zip" `
-OutFile openssl-1.1.1w.zip
Expand-Archive openssl-1.1.1w.zip -DestinationPath openssl111
- name: Copy OpenSSL to Qt MinGW path
shell: pwsh
working-directory: ${{ github.workspace }}
run: |
dir ${{ github.workspace }}\..\Qt\
dir ${{ github.workspace }}\..\Qt\Tools\
dir ${{ github.workspace }}\..\Qt\Tools\mingw810_32\
$openssl = (Get-ChildItem -Directory -Path "${{ github.workspace }}\openssl111" | Where-Object { $_.Name -like "openssl-*" } | Select-Object -First 1).FullName + "\x86"
$mingwRoot = "${{ github.workspace }}\..\Qt\Tools\mingw810_32"
Write-Host "Resolved OpenSSL path: $openssl"
if (Test-Path $openssl) {
Get-ChildItem -Recurse "$openssl" | ForEach-Object { Write-Host $_.FullName }
} else {
Write-Error "OpenSSL path not found: $openssl"
}
Copy-Item "$openssl\bin\libcrypto-1_1.dll" "$mingwRoot\bin\" -Force
Copy-Item "$openssl\bin\libssl-1_1.dll" "$mingwRoot\bin\" -Force
Copy-Item "$openssl\lib\libcrypto.lib" "$mingwRoot\lib\" -Force
Copy-Item "$openssl\lib\libssl.lib" "$mingwRoot\lib\" -Force
New-Item -ItemType Directory -Force -Path "$mingwRoot\include\openssl"
Write-Host "Copying OpenSSL headers from: $openssl\include\openssl\."
Copy-Item "$openssl\include\openssl\." "$mingwRoot\include\" -Recurse -Force -Verbose
dir "$mingwRoot\include\openssl\"
- name: Install NSIS
run: choco install nsis --x86 --force -y
- name: Show Qt & CMake Info
run: |
where gcc
where g++
cmake --version
- name: Debug OpenSSL include headers
shell: pwsh
working-directory: ${{ github.workspace }}
run: |
$opensslInclude = "$Env:GITHUB_WORKSPACE\..\Qt\Tools\mingw810_32\include\openssl"
$openssl = (Get-ChildItem -Directory -Path "${{ github.workspace }}\openssl111" | Where-Object { $_.Name -like "openssl-*" } | Select-Object -First 1).FullName + "\x86"
Write-Host "Looking in: $opensslInclude"
if (Test-Path $opensslInclude) {
Get-ChildItem $opensslInclude | Select-Object -First 20
} else {
Write-Error "OpenSSL include directory not found!"
}
dir "$openssl\include\openssl\"
- name: Configure CMake
shell: cmd
working-directory: src
run: |
dir "%GITHUB_WORKSPACE%\openssl111\openssl-1.1\x86\include"
mkdir build
cd build
cmake .. -G "MinGW Makefiles" ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_C_COMPILER="%GITHUB_WORKSPACE%\..\Qt\Tools\mingw810_32\bin\gcc.exe" ^
-DCMAKE_CXX_COMPILER="%GITHUB_WORKSPACE%\..\Qt\Tools\mingw810_32\bin\g++.exe" ^
-DOPENSSL_INCLUDE_DIR="%GITHUB_WORKSPACE%\openssl111\openssl-1.1\x86\include" ^
-DOPENSSL_LIBRARIES="%GITHUB_WORKSPACE%\openssl111\openssl-1.1\x86\lib"
- name: Check CMake Cache
run: |
dir build
type build\CMakeCache.txt || echo "Cache missing"
- name: Build
shell: pwsh
run: |
$env:PATH = "$Env:GITHUB_WORKSPACE\..\Qt\5.15.2\mingw81_32\bin;$Env:GITHUB_WORKSPACE\..\Qt\Tools\mingw810_32\bin;$env:PATH"
cd build
cmake --build . --verbose
- name: Copy OpenSSL DLLs to build folder
shell: pwsh
run: |
Copy-Item "$Env:GITHUB_WORKSPACE\..\Qt\Tools\mingw810_32\bin\libssl-1_1.dll" -Destination "$Env:GITHUB_WORKSPACE\src\build\"
Copy-Item "$Env:GITHUB_WORKSPACE\..\Qt\Tools\mingw810_32\bin\libcrypto-1_1.dll" -Destination "$Env:GITHUB_WORKSPACE\src\build\"
- name: Build NSIS Installer
shell: pwsh
working-directory: src\build
run: |
& "${Env:ProgramFiles(x86)}\NSIS\makensis.exe" "openhdimagewriter.nsi"
- name: Upload Installer
uses: actions/upload-artifact@v4
with:
name: OpenHDImageWriter-Build-Full
path: src/build/OpenHD-ImageWriter-*
if-no-files-found: error