From b149e361015c37cf894f5d153c413b4dc7407d3c Mon Sep 17 00:00:00 2001 From: Andrei Drexler Date: Sat, 18 Nov 2023 09:58:40 +0100 Subject: [PATCH] Retain Windows CI build artifacts --- .github/workflows/windows_ci.yml | 14 ++++++++++++++ Windows/VisualStudio/custom_build.props | 12 ++++++++++++ Windows/VisualStudio/print_build_suffix.bat | 10 ++++++++++ 3 files changed, 36 insertions(+) create mode 100644 Windows/VisualStudio/custom_build.props create mode 100644 Windows/VisualStudio/print_build_suffix.bat diff --git a/.github/workflows/windows_ci.yml b/.github/workflows/windows_ci.yml index ef35263d6..c7e53cdf9 100644 --- a/.github/workflows/windows_ci.yml +++ b/.github/workflows/windows_ci.yml @@ -17,8 +17,22 @@ jobs: $options = @( ` '-property:Configuration=Release', ` '-property:Platform=${{ matrix.platform }}', ` + '-property:ForceImportBeforeCppTargets=Windows\VisualStudio\custom_build.props', ` + '-property:VER_SUFFIX=$(Windows\VisualStudio\print_build_suffix.bat)', ` '-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$(Windows\VisualStudio\print_build_suffix.bat)-${{ 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 diff --git a/Windows/VisualStudio/custom_build.props b/Windows/VisualStudio/custom_build.props new file mode 100644 index 000000000..c8632be23 --- /dev/null +++ b/Windows/VisualStudio/custom_build.props @@ -0,0 +1,12 @@ + + + + + /DIRONWAIL_VER_SUFFIX=\"$(VER_SUFFIX)\" %(AdditionalOptions) + + + + $(SolutionDir)$(BUILD_DIR)\ + $(BUILD_DIR)\Out\ + + diff --git a/Windows/VisualStudio/print_build_suffix.bat b/Windows/VisualStudio/print_build_suffix.bat new file mode 100644 index 000000000..84b053f38 --- /dev/null +++ b/Windows/VisualStudio/print_build_suffix.bat @@ -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% +)