Merge branch 'master' of https://github.com/sezero/quakespasm #571
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: Windows CI | |
on: [push, pull_request] | |
jobs: | |
build: | |
name: Windows / ${{ matrix.platform }} | |
runs-on: windows-2022 | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [x64, Win32] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set environment variables | |
run: | | |
$gitrev = $(git describe --always) | |
$gitbranch = $(git branch --show-current) | |
$ver_suffix = ("$gitbranch" -eq "master" -Or "$gitbranch" -eq "main") ? "-$gitrev" : "-$gitbranch-$gitrev" | |
$platform_alt = ("${{matrix.platform}}" -eq "x64") ? "win64" : "win32" | |
$platform_short = ("${{matrix.platform}}" -eq "Win32") ? "x86" : "${{matrix.platform}}" | |
$build_artifact = "ironwail${ver_suffix}-${platform_alt}" | |
echo "VER_SUFFIX=$ver_suffix" >> ${env:GITHUB_ENV} | |
echo "BUILD_ARTIFACT=$build_artifact" >> ${env:GITHUB_ENV} | |
echo "BUILD_DIR=$build_artifact" >> ${env:GITHUB_ENV} | |
echo "PLATFORM_ALT=$platform_alt" >> ${env:GITHUB_ENV} | |
echo "PLATFORM_SHORT=$platform_short" >> ${env:GITHUB_ENV} | |
echo "ForceImportBeforeCppTargets=${env:GITHUB_WORKSPACE}\Windows\VisualStudio\custom_build.props" >> ${env:GITHUB_ENV} | |
- name: Build | |
run: | | |
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" | |
$msbuild = & "$vswhere" -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe | select-object -first 1 | |
$options = @( ` | |
'-property:Configuration=Release', ` | |
'-property:Platform=${{ matrix.platform }}', ` | |
'-maxcpucount', ` | |
'-verbosity:minimal' ` | |
) | |
& $msbuild Windows\VisualStudio\ironwail.sln $options | |
if (-not $?) { throw "Build failed" } | |
- name: Prepare archive | |
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' | |
run: | | |
$compiledir = "Windows\VisualStudio\${env:BUILD_DIR}" | |
$zipdir = "artifact\${env:BUILD_ARTIFACT}" | |
mkdir $zipdir | out-null | |
copy ${compiledir}\*.exe $zipdir | |
copy ${compiledir}\*.dll $zipdir | |
copy Quake\ironwail.pak $zipdir | |
copy Quakespasm.html $zipdir | |
copy Quakespasm.txt $zipdir | |
copy Quakespasm-Music.txt $zipdir | |
copy LICENSE.txt $zipdir | |
- name: Upload archive | |
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.BUILD_ARTIFACT }} | |
path: artifact/* |