Skip to content

Commit

Permalink
ci: Fix Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
vasylskorych committed Oct 8, 2024
1 parent e7fdb85 commit 808d310
Showing 1 changed file with 10 additions and 21 deletions.
31 changes: 10 additions & 21 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,8 @@ name: Windows
on: [push]

env:
# Path to the solution/project files relative to the root of the project.
SOLUTION_FILE_PATH: .
SOLUTION_FILE_NAME: musen.sln
INSTALLER_PROJECT_PATH: ./Installers/InstallerProject/

# Configuration type to build.
BUILD_CONFIGURATION: Release
BUILD_PLATFORM: x64

# Versions
QT_VERSION: 5.15.2
QT_VS_VERSION: msvc2019_64
QT_VS_ADDIN_VERSION: 3.2.0
QT_VS_ADDIN_URL: https://ftp.fau.de/qtproject/archive/vsaddin/3.2.0/qt-vsaddin-msvc2022-x64-3.2.0-rev.47.vsix

jobs:
build:
Expand All @@ -42,7 +31,7 @@ jobs:
# If cached, only install essential build tools and set environmental variables.
cache-key-prefix: 'cache-qt'
# Version of Qt to install.
version: ${{env.QT_VERSION}}
version: 5.15.2
# Architecture.
arch: win64_msvc2019_64
# Directory to install.
Expand All @@ -64,7 +53,7 @@ jobs:
# Also, it installs them to %LOCALAPPDATA%\QtMsBuild, so they can not be used by other Windows users.
# Download the extension and extract requited files to the project directory.
run: |
Invoke-WebRequest -Uri https://ftp.fau.de/qtproject/archive/vsaddin/${{env.QT_VS_ADDIN_VERSION}}/qt-vsaddin-msvc2022-x64-${{env.QT_VS_ADDIN_VERSION}}-rev.47.vsix -MaximumRetryCount 10 -RetryIntervalSec 30 -OutFile vspackage.vsix
Invoke-WebRequest -Uri ${{env.QT_VS_ADDIN_URL}} -MaximumRetryCount 10 -RetryIntervalSec 30 -OutFile vspackage.vsix
Expand-Archive vspackage.vsix -DestinationPath ${{github.workspace}}/ExternalLibraries/qtvsaddin
- name: Cache ZLib
Expand Down Expand Up @@ -125,7 +114,7 @@ jobs:
QtToolsPath: ${{env.QT_ROOT_DIR}}/bin
QtMsBuild: ${{github.workspace}}/ExternalLibraries/qtvsaddin/QtMsBuild
# Add additional options to the MSBuild command line here: see https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference.
run: msbuild -maxCpuCount -verbosity:minimal -property:Configuration=${{env.BUILD_CONFIGURATION}} -property:Platform=${{env.BUILD_PLATFORM}} ${{env.SOLUTION_FILE_PATH}}/${{env.SOLUTION_FILE_NAME}}
run: msbuild -maxCpuCount -verbosity:minimal -p:Zm=100 -property:Configuration=Release -property:Platform=x64 ${{github.workspace}}/musen.sln

installer:
runs-on: windows-latest
Expand All @@ -150,7 +139,7 @@ jobs:
# If cached, only install essential build tools and set environmental variables.
cache-key-prefix: 'cache-qt'
# Version of Qt to install.
version: ${{env.QT_VERSION}}
version: 5.15.2
# Architecture.
arch: win64_msvc2019_64
# Directory to install.
Expand All @@ -172,7 +161,7 @@ jobs:
# Also, it installs them to %LOCALAPPDATA%\QtMsBuild, so they can not be used by other Windows users.
# Download the extension and extract requited files to the project directory.
run: |
Invoke-WebRequest -Uri https://ftp.fau.de/qtproject/archive/vsaddin/${{env.QT_VS_ADDIN_VERSION}}/qt-vsaddin-msvc2022-x64-${{env.QT_VS_ADDIN_VERSION}}-rev.47.vsix -MaximumRetryCount 10 -RetryIntervalSec 30 -OutFile vspackage.vsix
Invoke-WebRequest -Uri ${{env.QT_VS_ADDIN_URL}} -MaximumRetryCount 10 -RetryIntervalSec 30 -OutFile vspackage.vsix
Expand-Archive vspackage.vsix -DestinationPath ${{github.workspace}}/ExternalLibraries/qtvsaddin
- name: Cache ZLib
Expand Down Expand Up @@ -233,15 +222,15 @@ jobs:
QtToolsPath: ${{env.QT_ROOT_DIR}}/bin
QtMsBuild: ${{github.workspace}}/ExternalLibraries/qtvsaddin/QtMsBuild
run: |
msbuild -maxCpuCount -verbosity:minimal -property:Configuration=Debug -property:Platform=${{env.BUILD_PLATFORM}} ${{env.SOLUTION_FILE_PATH}}/${{env.SOLUTION_FILE_NAME}}
msbuild -maxCpuCount -verbosity:minimal -property:Configuration=Release -property:Platform=${{env.BUILD_PLATFORM}} ${{env.SOLUTION_FILE_PATH}}/${{env.SOLUTION_FILE_NAME}}
msbuild -maxCpuCount:3 -verbosity:minimal -p:Zm=100 -property:Configuration=Debug -property:Platform=x64 ${{github.workspace}}/musen.sln
msbuild -maxCpuCount -verbosity:minimal -p:Zm=100 -property:Configuration=Release -property:Platform=x64 ${{github.workspace}}/musen.sln
- name: Build Installer
working-directory: ${{github.workspace}}
env:
QtToolsPath: ${{env.QT_ROOT_DIR}}/bin
QtMsBuild: ${{github.workspace}}/ExternalLibraries/qtvsaddin/QtMsBuild
run: msbuild -maxCpuCount -verbosity:minimal -property:Configuration=${{env.BUILD_CONFIGURATION}} -property:Platform=${{env.BUILD_PLATFORM}} -property:SolutionDir=${{github.workspace}}/ -property:SolutionPath=${{github.workspace}}/${{env.SOLUTION_FILE_NAME}} -property:QtInstallDir=${{github.workspace}}/ExternalLibraries/qt/Qt/${{env.QT_VERSION}}/${{env.QT_VS_VERSION}}/ ${{env.INSTALLER_PROJECT_PATH}}
run: msbuild -maxCpuCount -verbosity:minimal -p:Zm=100 -property:Configuration=Release -property:Platform=x64 -property:SolutionDir=${{github.workspace}}/ -property:SolutionPath=${{github.workspace}}/musen.sln -property:QtInstallDir=${{github.workspace}}/ExternalLibraries/qt/Qt/5.15.2/msvc2019_64/ ${{github.workspace}}/Installers/InstallerProject/

- name: Run Installer
shell: pwsh
Expand Down Expand Up @@ -271,7 +260,7 @@ jobs:
shell: pwsh
run: |
$UnInstallerFile = Resolve-Path "${{ env.LOCALAPPDATA_DIR }}/Programs/MUSEN/unins000.exe"
Start-Process -FilePath $UnInstallerFile -ArgumentList "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /skipaskconfig=yes" -Wait
Start-Process -FilePath $UnInstallerFile -ArgumentList "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART" -Wait
release:
runs-on: windows-latest
Expand Down

0 comments on commit 808d310

Please sign in to comment.