11name : Windows MSVC Release
2- on :
2+ on :
33 push :
44 tags :
55 - " *"
99 strategy :
1010 matrix :
1111 include :
12+ # 64-bit build
1213 - name : win64_msvc
1314 os : windows-2022
1415 build_type : Release
15- compiler_type : msvc2019_64
1616 msvc_arch : x64
1717 qt_arch : win64_msvc2019_64
1818 qt_version : 5.15.2
1919 qt_target : desktop
20+ # 32-bit build
21+ - name : win32_msvc
22+ os : windows-2022
23+ build_type : Release
24+ msvc_arch : x86
25+ qt_arch : win32_msvc2019_64
26+ qt_version : 5.15.2
27+ qt_target : desktop
2028 runs-on : ${{ matrix.os }}
2129 env :
2230 BUILD_TYPE : ${{ matrix.build_type }}
23- COMPILER_TYPE : ${{ matrix.compiler_type }}
2431 QT_VERSION : ${{ matrix.qt_version }}
25- OPENSSL_ROOT_DIR : C:\Program Files\OpenSSL
26- OPENSSL_INCLUDE_DIR : C:\Program Files\OpenSSL\include
27- OPENSSL_CRYPTO_LIBRARY : C:\Program Files\OpenSSL\lib
32+ COO_PROJECT : dde-cooperation
33+ DT_PROJECT : data-transfer
34+ # OpenSSL paths based on architecture
35+ OPENSSL_ROOT_DIR : ${{ matrix.msvc_arch == 'x64' && 'C:\Program Files\OpenSSL' || 'C:\Program Files (x86)\OpenSSL' }}
2836 steps :
29- # force 6.2.2 version of Inno Setup
30- # - name: Install Inno Setup
31- # run: |
32- # choco install innosetup --version 6.2.2 --allow-downgrade -y
33-
34- - name : ' ⚙️ Cache Qt'
37+ - name : " ⚙️ Cache Qt"
3538 id : cache-qt
3639 uses : actions/cache@v3
3740 with :
3841 path : ..\Qt
39- key : Windows-QtCache-${{ env.QT_VERSION }}
42+ key : Windows-QtCache-${{ env.QT_VERSION }}-${{ matrix.qt_arch }}
4043
41- - name : Install Qt ${{ env.QT_VERSION }}
44+ - name : Install Qt ${{ env.QT_VERSION }} ${{ matrix.qt_arch }}
4245 uses : jurplel/install-qt-action@v3
4346 with :
44- aqtversion : ' ==3.1.*'
47+ aqtversion : " ==3.1.*"
4548 version : ${{ env.QT_VERSION }}
4649 target : ${{ matrix.qt_target }}
4750 arch : ${{ matrix.qt_arch }}
48- # modules: 'qt5compat'
49- # cached: 'false'
5051 cached : ${{ steps.cache-qt.outputs.cache-hit }}
5152
52- # Use CMake 3.31.x for better OpenSSL 3.x compatibility while supporting VS 2022
5353 - name : Setup cmake
5454 uses : lukka/get-cmake@latest
5555 with :
@@ -63,115 +63,89 @@ jobs:
6363 fetch-depth : 0
6464
6565 - name : msvc-build
66- id : build
6766 shell : cmd
6867 env :
6968 vc_arch : ${{ matrix.msvc_arch }}
7069 cmake_gen : Visual Studio 17 2022
71- COO_PROJECT : dde-cooperation
72- DT_PROJECT : data-transfer
73- BONJOUR_SDK : ${{ github.workspace }}\source\3rdparty\ext\BonjourSDK
70+ APP_VERSION : ${{ github.ref_name }}
7471 run : |
75- REM Use Visual Studio 2022 Enterprise (pre-installed on Windows 2022 runner)
72+ REM Use Visual Studio 2022 Enterprise
7673 set "VS2022_PATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
77- if not exist "%VS2022_PATH%\VC\Auxiliary\Build\vcvarsall.bat" (
78- echo Visual Studio 2022 Enterprise not found at expected location!
79- exit /b 1
80- )
81- echo Using Visual Studio 2022 at: %VS2022_PATH%
8274 call "%VS2022_PATH%\VC\Auxiliary\Build\vcvarsall.bat" %vc_arch%
83-
84- REM Initialize OpenSSL environment (based on start.bat logic)
85- echo ============== OpenSSL Initialization ==============
86- echo Setting up OpenSSL environment...
87-
88- REM Add OpenSSL bin directory to PATH (following start.bat pattern)
89- set "PATH=%PATH%;%OPENSSL_ROOT_DIR%\bin"
90- echo Updated PATH: %OPENSSL_ROOT_DIR%\bin added to PATH
91-
92- REM Verify OpenSSL installation (like start.bat does)
93- echo.
94- echo Verifying OpenSSL installation:
95- openssl version -a
96- echo.
97- echo OpenSSL environment ready
75+
76+ echo ============== Build Configuration ==============
77+ echo Architecture: %vc_arch%
78+ echo OpenSSL: %OPENSSL_ROOT_DIR%
79+ echo App Version: %APP_VERSION%
9880 echo ================================================
99-
100- REM Display key OpenSSL environment variables
101- echo OpenSSL Configuration:
102- echo OPENSSL_ROOT_DIR: %OPENSSL_ROOT_DIR%
103- echo OPENSSL_INCLUDE_DIR: %OPENSSL_INCLUDE_DIR%
104- echo OPENSSL_CRYPTO_LIBRARY: %OPENSSL_CRYPTO_LIBRARY%
105- echo.
106-
107- mkdir build && cd build
108- mkdir installer-inno
109- echo Current working directory: %CD%
110- echo Source directory: %GITHUB_WORKSPACE%\source
111- if exist "%GITHUB_WORKSPACE%\source\CMakeLists.txt" (
112- echo Found CMakeLists.txt in source directory
113- cmake -G "%cmake_gen%" -A %vc_arch% -D CMAKE_BUILD_TYPE=%BUILD_TYPE% -D APP_VERSION="${{ github.ref_name }}" "%GITHUB_WORKSPACE%\source"
114- ) else (
115- echo ERROR: CMakeLists.txt not found in source directory
116- dir "%GITHUB_WORKSPACE%\source"
117- exit /b 1
118- )
119- cmake --build . --config %BUILD_TYPE%
12081
121- echo ------------copy files to output directory------------
82+ mkdir build && cd build
12283
123- if exist output\%BUILD_TYPE% (
124- copy output\%BUILD_TYPE%\* output\%COO_PROJECT%\%BUILD_TYPE%\ > NUL
125- REM del output\%COO_PROJECT%\%BUILD_TYPE%\quazip* > NUL
126-
127- copy "%OPENSSL_ROOT_DIR%\bin\libcrypto-3-x64.dll" output\%COO_PROJECT%\%BUILD_TYPE%\ > NUL
128- copy "%OPENSSL_ROOT_DIR%\bin\libssl-3-x64.dll" output\%COO_PROJECT%\%BUILD_TYPE%\ > NUL
129-
130- mkdir installer-inno\%COO_PROJECT%
131- copy "%BONJOUR_SDK%\Bonjour64.msi" installer-inno\%COO_PROJECT%\ > NUL
132- if exist output\%COO_PROJECT%\%BUILD_TYPE%\vc_redist.x64.exe (
133- move output\%COO_PROJECT%\%BUILD_TYPE%\vc_redist.x64.exe installer-inno\%COO_PROJECT%\ > NUL
134- )
84+ echo ------------CMake Configuration------------
85+ cmake -G "%cmake_gen%" -A %vc_arch% ^
86+ -D CMAKE_BUILD_TYPE=%BUILD_TYPE% ^
87+ -D CMAKE_PREFIX_PATH="%Qt5_DIR%" ^
88+ -D QT_VERSION=%QT_VERSION% ^
89+ -D APP_VERSION=%APP_VERSION% ^
90+ -D ENABLE_WIX=ON ^
91+ "%GITHUB_WORKSPACE%\source"
92+ if ERRORLEVEL 1 exit /b 1
13593
94+ echo ------------Build Project------------
95+ cmake --build . --config %BUILD_TYPE%
96+ if ERRORLEVEL 1 exit /b 1
13697
137- REM copy output\%BUILD_TYPE%\quazip* output\%DT_PROJECT%\%BUILD_TYPE%\ > NUL
138-
139- copy "%OPENSSL_ROOT_DIR%\bin\libcrypto-3-x64.dll" output\%DT_PROJECT%\%BUILD_TYPE%\ > NUL
140- copy "%OPENSSL_ROOT_DIR%\bin\libssl-3-x64.dll" output\%DT_PROJECT%\%BUILD_TYPE%\ > NUL
141- mkdir installer-inno\%DT_PROJECT%
142- copy "%B_BONJOUR%\Bonjour64.msi" installer-inno\%DT_PROJECT%\ > NUL
143- if exist output\%DT_PROJECT%\%BUILD_TYPE%\vc_redist.x64.exe (
144- move output\%DT_PROJECT%\%BUILD_TYPE%\vc_redist.x64.exe installer-inno\%DT_PROJECT%\ > NUL
98+ echo ------------Copy Dependencies------------
99+ if exist output\%BUILD_TYPE% (
100+ if "%vc_arch%"=="x64" (
101+ copy "%OPENSSL_ROOT_DIR%\bin\libcrypto-3-x64.dll" output\%COO_PROJECT%\%BUILD_TYPE%\ > NUL
102+ copy "%OPENSSL_ROOT_DIR%\bin\libssl-3-x64.dll" output\%COO_PROJECT%\%BUILD_TYPE%\ > NUL
103+ copy "%OPENSSL_ROOT_DIR%\bin\libcrypto-3-x64.dll" output\%DT_PROJECT%\%BUILD_TYPE%\ > NUL
104+ copy "%OPENSSL_ROOT_DIR%\bin\libssl-3-x64.dll" output\%DT_PROJECT%\%BUILD_TYPE%\ > NUL
105+ ) else (
106+ copy "%OPENSSL_ROOT_DIR%\bin\libcrypto-3-x86.dll" output\%COO_PROJECT%\%BUILD_TYPE%\ > NUL
107+ copy "%OPENSSL_ROOT_DIR%\bin\libssl-3-x86.dll" output\%COO_PROJECT%\%BUILD_TYPE%\ > NUL
108+ copy "%OPENSSL_ROOT_DIR%\bin\libcrypto-3-x86.dll" output\%DT_PROJECT%\%BUILD_TYPE%\ > NUL
109+ copy "%OPENSSL_ROOT_DIR%\bin\libssl-3-x86.dll" output\%DT_PROJECT%\%BUILD_TYPE%\ > NUL
145110 )
146- ) else (
147- echo Remember to copy supporting binaries and configuration files!
148111 )
149112
150- echo Build completed successfully
113+ echo ------------Build Packages (Inno + WiX)------------
114+ cmake --build . --config %BUILD_TYPE% --target package
115+ if ERRORLEVEL 1 echo Warning: Package build failed, continuing...
151116
152- - name : Inno Setup data-transfer
153- uses :
nadeemjazmawe/[email protected] 154- with :
155- filepath : build/deepin-data-transfer-setup.iss
117+ - name : Make Installer Archives
118+ run : |
119+ # Archive all installers
120+ if exist "build/_CPack_Packages" (
121+ New-Item -ItemType Directory -Force -Path build/installers
122+ Get-ChildItem -Path build/_CPack_Packages -Recurse -Filter *.msi | ForEach-Object {
123+ $dest = "build/installers/$($_.Name)"
124+ Move-Item $_.FullName -Destination $dest -Force
125+ }
126+ Compress-Archive -Path build/installers/* -DestinationPath build/installers-${{ matrix.msvc_arch }}.zip
127+ }
128+ if exist "build/_CPack_Packages" (
129+ Get-ChildItem -Path build/_CPack_Packages -Recurse -Filter *.7z | ForEach-Object {
130+ Copy-Item $_.FullName -Destination build/
131+ }
132+ }
156133
157- - name : Inno Setup cooperation
158- uses :
nadeemjazmawe/[email protected] 134+ - name : Upload Build Artifacts
135+ uses : actions/upload-artifact@v4
159136 with :
160- filepath : build/dde-cooperation-setup.iss
161-
162- - name : Make Installer Directories
163- run : |
164- move build/installer-inno/deepin-cooperation-* build/installer-inno/dde-cooperation/ > NUL
165- powershell -Command "Compress-Archive -Path build/installer-inno/dde-cooperation/* -DestinationPath build/installer-inno/dde-cooperation.zip"
166- move build/installer-inno/deepin-datatransfer-* build/installer-inno/data-transfer/ > NUL
167- powershell -Command "Compress-Archive -Path build/installer-inno/data-transfer/* -DestinationPath build/installer-inno/deepin-data-transfer.zip"
137+ name : windows-installers-${{ matrix.msvc_arch }}
138+ path : |
139+ build/*.zip
140+ build/*.7z
141+ retention-days : 30
168142
169143 - name : Create Release
170144 uses : softprops/action-gh-release@v1
171145 if : startsWith(github.ref, 'refs/tags/')
172146 env :
173147 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
174148 with :
175- files : build/installer-inno/ *.zip
149+ files : build/*.zip
176150 generate_release_notes : true
177151 draft : true
0 commit comments