@@ -10,15 +10,47 @@ jobs:
1010 platform : [x64, Win32]
1111 steps :
1212 - uses : actions/checkout@v3
13+ - name : Set environment variables
14+ run : |
15+ $gitrev = $(git describe --always)
16+ $gitbranch = $(git branch --show-current)
17+ $build_suffix = ("$gitbranch" -eq "master" -Or "$gitbranch" -eq "main") ? "-$gitrev" : "-$gitbranch-$gitrev"
18+ $platform_alt = ("${{matrix.platform}}" -eq "x64") ? "win64" : "win32"
19+ $platform_short = ("${{matrix.platform}}" -eq "Win32") ? "x86" : "${{matrix.platform}}"
20+ $build_artifact = "ironwail${build_suffix}-${platform_alt}"
21+ echo "BUILD_SUFFIX=$build_suffix" >> ${env:GITHUB_ENV}
22+ echo "BUILD_ARTIFACT=$build_artifact" >> ${env:GITHUB_ENV}
23+ echo "BUILD_DIR=$build_artifact" >> ${env:GITHUB_ENV}
24+ echo "PLATFORM_ALT=$platform_alt" >> ${env:GITHUB_ENV}
25+ echo "PLATFORM_SHORT=$platform_short" >> ${env:GITHUB_ENV}
26+ echo "ForceImportBeforeCppTargets=${env:GITHUB_WORKSPACE}\Windows\VisualStudio\custom_build.props" >> ${env:GITHUB_ENV}
1327 - name : Build
1428 run : |
1529 $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
1630 $msbuild = & "$vswhere" -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe | select-object -first 1
1731 $options = @( `
1832 '-property:Configuration=Release', `
1933 '-property:Platform=${{ matrix.platform }}', `
34+ '-property:VER_SUFFIX=${env:BUILD_SUFFIX}', `
2035 '-maxcpucount', `
2136 '-verbosity:minimal' `
2237 )
2338 & $msbuild Windows\VisualStudio\ironwail.sln $options
2439 if (-not $?) { throw "Build failed" }
40+ - name : Prepare archive
41+ run : |
42+ $compiledir = "Windows\VisualStudio\${env:BUILD_DIR}"
43+ $zipdir = "artifact\${env:BUILD_ARTIFACT}"
44+ mkdir $zipdir | out-null
45+ copy ${compiledir}\*.exe $zipdir
46+ copy ${compiledir}\*.dll $zipdir
47+ copy Quake\ironwail.pak $zipdir
48+ copy Quakespasm.html $zipdir
49+ copy Quakespasm.txt $zipdir
50+ copy Quakespasm-Music.txt $zipdir
51+ copy LICENSE.txt $zipdir
52+ - name : Upload archive
53+ uses : actions/upload-artifact@v3
54+ with :
55+ name : ${{ env.BUILD_ARTIFACT }}
56+ path : artifact/*
0 commit comments