Fix Windows CI after they pointlessly broke older Visual Studio toolc… #101
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build PageEdit on Windows | |
on: | |
push: | |
branches: [ master ] | |
tags-ignore: | |
- '**' | |
paths-ignore: | |
- 'docs/**' | |
- 'installer/win_installer_note.txt' | |
- 'ChangeLog.txt' | |
- 'COPYING.txt' | |
- 'version.xml' | |
- '.retired_travis.yml' | |
- '.retired_appveyor.yml' | |
- '**/**.md' | |
pull_request: | |
branches: [ master ] | |
tags-ignore: | |
- '**' | |
paths-ignore: | |
- 'docs/**' | |
- 'installer/win_installer_note.txt' | |
- 'ChangeLog.txt' | |
- 'COPYING.txt' | |
- 'version.xml' | |
- '.retired_travis.yml' | |
- '.retired_appveyor.yml' | |
- '**/**.md' | |
env: | |
BUILD_TYPE: Release | |
DOWNLOADQT: https://github.com/dougmassay/win-qtwebkit-5.212/releases/download/v5.212-1/Qt6.6.2e_x64_VS2022.7z | |
QT: Qt6.6.2 | |
INNO: C:\Program Files (x86)\Inno Setup 6 | |
CMAKE64BIT: -DWIN_INSTALLER_USE_64BIT_CRT=1 | |
jobs: | |
build: | |
if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11.3 | |
- name: Cache Custom Qt | |
uses: actions/cache@v4 | |
with: | |
path: ${{runner.workspace}}\${{env.QT}} | |
key: ${{ runner.os }}-qtdeps-${{hashFiles('**/reset-win-caches.txt')}} | |
- name: Install Custom Qt | |
shell: cmd | |
run: | | |
if not exist ${{runner.workspace}}\%QT% cd ${{runner.workspace}} & curl -L -o qt.7z "%DOWNLOADQT%" & 7z x qt.7z -y | |
- uses: lukka/get-cmake@latest | |
- name: Create Build Environment | |
shell: cmd | |
run: | | |
set PATH=${{runner.workspace}}\%QT%\bin;%PATH% | |
echo ${{runner.workspace}} | |
mkdir ${{runner.workspace}}\build | |
cd ${{runner.workspace}}\build | |
qmake -v | |
- name: Build PageEdit | |
shell: cmd | |
working-directory: ${{runner.workspace}}\build | |
run: | | |
set PATH=${{runner.workspace}}\%QT%\bin;%PATH% | |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 | |
echo %PATH% | |
cmake %GITHUB_WORKSPACE% ^ | |
-G "Ninja" ^ | |
-DCMAKE_BUILD_TYPE=%BUILD_TYPE% ^ | |
-DQt6_DIR="${{runner.workspace}}\$QT\lib\cmake\Qt6" ^ | |
%CMAKE64BIT% | |
ninja -j2 | |
- name: Build Installer | |
shell: cmd | |
working-directory: ${{runner.workspace}}\build | |
if: "contains(github.event.head_commit.message, '[deploy]')" | |
run: | | |
set PATH=%INNO%;${{runner.workspace}}\%QT%\bin;%PATH% | |
set /p RedistVersion=<"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\Microsoft.VCRedistVersion.default.txt" | |
set REDIST=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\%RedistVersion%\vc_redist.x64.exe | |
echo "%REDIST%" | |
cp '%REDIST%' %GITHUB_WORKSPACE%\installer\vcredist_x64.exe | |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 | |
ninja -j2 deployinstaller | |
- uses: actions/upload-artifact@v4 | |
if: "contains(github.event.head_commit.message, '[deploy]')" | |
with: | |
name: pageedit-installer | |
path: ${{runner.workspace}}\build\deploy\*.exe | |
retention-days: 5 |