release-windows.yml: set up Visual Studio environment and added missing exitcode checks (#3998)

This commit is contained in:
Oliver Stöneberg 2022-04-11 19:16:58 +02:00 committed by GitHub
parent 902f46bae5
commit 07fb6c1853
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 37 additions and 39 deletions

View File

@ -30,8 +30,8 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Setup msbuild.exe - name: Set up Visual Studio environment
uses: microsoft/setup-msbuild@v1.0.2 uses: ilammy/msvc-dev-cmd@v1
- name: Cache PCRE - name: Cache PCRE
id: cache-pcre id: cache-pcre
@ -43,16 +43,16 @@ jobs:
- name: Download PCRE - name: Download PCRE
if: steps.cache-pcre.outputs.cache-hit != 'true' if: steps.cache-pcre.outputs.cache-hit != 'true'
run: | run: |
curl -fsSL https://github.com/pfultz2/pcre/archive/refs/tags/%PCRE_VERSION%.zip -o pcre-%PCRE_VERSION%.zip curl -fsSL https://github.com/pfultz2/pcre/archive/refs/tags/%PCRE_VERSION%.zip -o pcre-%PCRE_VERSION%.zip || exit /b !errorlevel!
- name: Install PCRE - name: Install PCRE
run: | run: |
7z x pcre-%PCRE_VERSION%.zip 7z x pcre-%PCRE_VERSION%.zip || exit /b !errorlevel!
cd pcre-%PCRE_VERSION% cd pcre-%PCRE_VERSION% || exit /b !errorlevel!
cmake . -G "Visual Studio 16 2019" -A x64 -DPCRE_BUILD_PCRECPP=OFF -DPCRE_BUILD_PCREGREP=OFF -DPCRE_BUILD_TESTS=OFF cmake . -G "Visual Studio 16 2019" -A x64 -DPCRE_BUILD_PCRECPP=OFF -DPCRE_BUILD_PCREGREP=OFF -DPCRE_BUILD_TESTS=OFF || exit /b !errorlevel!
msbuild -m PCRE.sln /p:Configuration=Release /p:Platform=x64 msbuild -m PCRE.sln -p:Configuration=Release -p:Platform=x64 || exit /b !errorlevel!
copy pcre.h ..\externals copy pcre.h ..\externals || exit /b !errorlevel!
copy Release\pcre.lib ..\externals\pcre64.lib copy Release\pcre.lib ..\externals\pcre64.lib || exit /b !errorlevel!
- name: Cache Qt ${{ env.QT_VERSION }} - name: Cache Qt ${{ env.QT_VERSION }}
id: cache-qt id: cache-qt
@ -70,58 +70,56 @@ jobs:
- name: Create .qm - name: Create .qm
run: | run: |
cd gui cd gui || exit /b !errorlevel!
lupdate gui.pro -no-obsolete lupdate gui.pro -no-obsolete || exit /b !errorlevel!
lrelease gui.pro -removeidentical lrelease gui.pro -removeidentical || exit /b !errorlevel!
- name: Matchcompiler - name: Matchcompiler
run: python tools\matchcompiler.py --write-dir lib run: python tools\matchcompiler.py --write-dir lib || exit /b !errorlevel!
- name: Build x64 release GUI - name: Build x64 release GUI
run: | run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" cd gui || exit /b !errorlevel!
cd gui qmake HAVE_QCHART=yes || exit /b !errorlevel!
qmake HAVE_QCHART=yes nmake release || exit /b !errorlevel!
nmake release
env: env:
CL: /MP CL: /MP
- name: Deploy app - name: Deploy app
run: | run: |
windeployqt Build\gui windeployqt Build\gui || exit /b !errorlevel!
del Build\gui\cppcheck-gui.ilk del Build\gui\cppcheck-gui.ilk || exit /b !errorlevel!
del Build\gui\cppcheck-gui.pdb del Build\gui\cppcheck-gui.pdb || exit /b !errorlevel!
- name: Build CLI x64 release configuration using MSBuild - name: Build CLI x64 release configuration using MSBuild
run: msbuild -m cppcheck.sln /t:cli /p:Configuration=Release-PCRE /p:Platform=x64 run: msbuild -m cppcheck.sln -t:cli -p:Configuration=Release-PCRE -p:Platform=x64 || exit /b !errorlevel!
- name: Collect files - name: Collect files
run: | run: |
move Build\gui win_installer\files move Build\gui win_installer\files || exit /b !errorlevel!
mkdir win_installer\files\addons mkdir win_installer\files\addons || exit /b !errorlevel!
copy addons\*.* win_installer\files\addons copy addons\*.* win_installer\files\addons || exit /b !errorlevel!
mkdir win_installer\files\cfg mkdir win_installer\files\cfg || exit /b !errorlevel!
copy cfg\*.cfg win_installer\files\cfg copy cfg\*.cfg win_installer\files\cfg || exit /b !errorlevel!
mkdir win_installer\files\platforms :: "platforms" is a folder used by Qt as well so it already exists
copy platforms\*.xml win_installer\files\platforms :: mkdir win_installer\files\platforms || exit /b !errorlevel!
copy bin\cppcheck.exe win_installer\files copy platforms\*.xml win_installer\files\platforms || exit /b !errorlevel!
copy bin\cppcheck-core.dll win_installer\files copy bin\cppcheck.exe win_installer\files || exit /b !errorlevel!
mkdir win_installer\files\help copy bin\cppcheck-core.dll win_installer\files || exit /b !errorlevel!
xcopy /s gui\help win_installer\files\help mkdir win_installer\files\help || exit /b !errorlevel!
del win_installer\files\translations\*.qm xcopy /s gui\help win_installer\files\help || exit /b !errorlevel!
move gui\*.qm win_installer\files\translations del win_installer\files\translations\*.qm || exit /b !errorlevel!
move gui\*.qm win_installer\files\translations || exit /b !errorlevel!
- name: Build Installer - name: Build Installer
run: | run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" cd win_installer || exit /b !errorlevel!
cd win_installer
REM Read ProductVersion REM Read ProductVersion
for /f "tokens=4 delims= " %%a in ('find "ProductVersion" productInfo.wxi') do set PRODUCTVER=%%a for /f "tokens=4 delims= " %%a in ('find "ProductVersion" productInfo.wxi') do set PRODUCTVER=%%a
REM Remove double quotes REM Remove double quotes
set PRODUCTVER=%PRODUCTVER:"=% set PRODUCTVER=%PRODUCTVER:"=%
echo ProductVersion=%PRODUCTVER% echo ProductVersion="%PRODUCTVER%" || exit /b !errorlevel!
msbuild -m cppcheck.wixproj /p:Platform=x64,ProductVersion=%PRODUCTVER%.${{ github.run_number }} msbuild -m cppcheck.wixproj -p:Platform=x64,ProductVersion=%PRODUCTVER%.${{ github.run_number }} || exit /b !errorlevel!
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with: