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 e78c96b
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/windows_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,47 @@ 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=$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 }}', `
'-property:VER_SUFFIX=${env:BUILD_SUFFIX}', `
'-maxcpucount', `
'-verbosity:minimal' `
)
& $msbuild Windows\VisualStudio\ironwail.sln $options
if (-not $?) { throw "Build failed" }
- name: Prepare archive
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
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_ARTIFACT }}
path: artifact/*
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 e78c96b

Please sign in to comment.