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 791800f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/windows_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,33 @@ jobs:
platform: [x64, Win32]
steps:
- uses: actions/checkout@v3
- name: Set env
run: |
$suffix = $(Windows\VisualStudio\print_build_suffix.bat)
echo "BUILD_SUFFIX=${suffix}" >> ${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:ForceImportBeforeCppTargets=Windows\VisualStudio\custom_build.props', `
'-property:VER_SUFFIX=${env:BUILD_SUFFIX}', `
'-maxcpucount', `
'-verbosity:minimal' `
)
& $msbuild Windows\VisualStudio\ironwail.sln $options
if (-not $?) { throw "Build failed" }
- name: Upload build
uses: actions/upload-artifact@v3
with:
name: ironwail${{ env.BUILD_SUFFIX }}-${{ matrix.platform }}
path: |
Windows\VisualStudio\Build-ironwail\**\*.exe
Windows\VisualStudio\Build-ironwail\**\*.dll
Quake\ironwail.pak
Quakespasm.html
Quakespasm.txt
Quakespasm-Music.txt
LICENSE.txt
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>
10 changes: 10 additions & 0 deletions Windows/VisualStudio/print_build_suffix.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@echo off
::Print build suffix (either -hash or -branch-hash)

for /f %%f in ('git describe --always') do set gitrev=%%f
for /f %%f in ('git branch --show-current') do set gitbranch=%%f
if /i "%gitbranch%" == "master" (
echo -%gitrev%
) else (
echo -%gitbranch%-%gitrev%
)

0 comments on commit 791800f

Please sign in to comment.