Skip to content

Commit

Permalink
Retain Windows CI build artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-drexler committed Nov 18, 2023
1 parent 48f7bb5 commit 0d28458
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/windows_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,48 @@ jobs:
platform: [x64, Win32]
steps:
- uses: actions/checkout@v3
- name: Set environment variables
run: |
$gitrev = $(git describe --always)
$gitbranch = $(git branch --show-current)
$build_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${build_suffix}-${platform_alt}"
echo "BUILD_SUFFIX=$build_suffix" >> ${env:GITHUB_ENV}
echo "BUILD_ARTIFACT=$build_artifact" >> ${env:GITHUB_ENV}
echo "BUILD_DIR=Windows\VisualStudio\$build_artifact" >> ${env:GITHUB_ENV}
echo "PLATFORM_ALT=$platform_alt" >> ${env:GITHUB_ENV}
echo "PLATFORM_SHORT=$platform_short" >> ${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 }}', `
'-property:VER_SUFFIX=${env:BUILD_SUFFIX}', `
'-property:BUILD_DIR=${env:BUILD_DIR}', `
'-property:ForceImportBeforeCppTargets=Windows\VisualStudio\custom_build.props', `
'-maxcpucount', `
'-verbosity:minimal' `
)
& $msbuild Windows\VisualStudio\ironwail.sln $options
if (-not $?) { throw "Build failed" }
- name: Prepare archive
run: |
rmdir -Force -Recurse ${env:BUILD_DIR}\Out
del ${env:BUILD_DIR}\ironwail.exp
del ${env:BUILD_DIR}\ironwail.lib
del ${env:BUILD_DIR}\ironwail.pdb
copy Quake\ironwail.pak ${env:BUILD_DIR}
copy Quakespasm.html ${env:BUILD_DIR}
copy Quakespasm.txt ${env:BUILD_DIR}
copy Quakespasm-Music.txt ${env:BUILD_DIR}
copy LICENSE.txt ${env:BUILD_DIR}
- name: Upload archive
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_ARTIFACT }}
path: |
${{ env.BUILD_DIR }}
12 changes: 12 additions & 0 deletions Windows/VisualStudio/custom_build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemDefinitionGroup Condition="'$(VER_SUFFIX)' != ''">
<ClCompile>
<AdditionalOptions>/DIRONWAIL_VER_SUFFIX=\&quot;$(VER_SUFFIX)\&quot; %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup Condition="'$(BUILD_DIR)' != ''">
<OutDir>$(SolutionDir)$(BUILD_DIR)\</OutDir>
<IntDir>$(BUILD_DIR)\Out\</IntDir>
</PropertyGroup>
</Project>

0 comments on commit 0d28458

Please sign in to comment.