Skip to content

Commit 9415b98

Browse files
committed
CI: produce versioned Windows release zips and installer, attach to releases on tag pushes
1 parent 30c76a7 commit 9415b98

2 files changed

Lines changed: 70 additions & 0 deletions

File tree

.github/workflows/build-msys2-clangarm64.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ jobs:
66
build-mingw:
77
name: ${{ matrix.platform.name }}
88
runs-on: ${{ matrix.platform.os }}
9+
permissions:
10+
contents: write
911

1012
defaults:
1113
run:
@@ -23,6 +25,7 @@ jobs:
2325
with:
2426
msystem: ${{ matrix.platform.msystem }}
2527
install: base-devel
28+
zip
2629
${{ matrix.platform.msys-env }}-gcc-compat
2730
${{ matrix.platform.msys-env }}-glslang
2831
${{ matrix.platform.msys-env }}-vulkan-headers
@@ -38,6 +41,16 @@ jobs:
3841

3942
- uses: actions/checkout@v6
4043

44+
- name: Determine version
45+
id: version
46+
shell: bash
47+
run: |
48+
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
49+
echo "version=$GITHUB_REF_NAME" >> "$GITHUB_OUTPUT"
50+
else
51+
echo "version=${GITHUB_SHA::8}" >> "$GITHUB_OUTPUT"
52+
fi
53+
4154
- name: Build MinGW
4255
run: |
4356
set -eu
@@ -50,3 +63,18 @@ jobs:
5063
path: |
5164
Quake/*.exe
5265
Quake/*.dll
66+
- name: Package
67+
run: |
68+
set -eu
69+
zip -j vkQuake-${{ steps.version.outputs.version }}_windows_arm64.zip Quake/*.exe Quake/*.dll LICENSE.txt
70+
- name: Upload package
71+
uses: actions/upload-artifact@v7
72+
with:
73+
name: vkQuake package (arm64)
74+
path: vkQuake-*_windows_arm64.zip
75+
- name: Attach to release
76+
if: startsWith(github.ref, 'refs/tags/')
77+
uses: softprops/action-gh-release@v2
78+
with:
79+
draft: true
80+
files: vkQuake-*_windows_arm64.zip

.github/workflows/build-windows.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,24 @@ jobs:
66
build-windows:
77
name: Build Windows
88
runs-on: windows-2025-vs2026
9+
permissions:
10+
contents: write
911
strategy:
1012
fail-fast: false
1113
matrix:
1214
configuration: [Release, Debug]
1315
platform: [x64]
1416
steps:
1517
- uses: actions/checkout@v6
18+
- name: Determine version
19+
id: version
20+
run: |
21+
if ($env:GITHUB_REF -like 'refs/tags/*') {
22+
$version = $env:GITHUB_REF_NAME
23+
} else {
24+
$version = $env:GITHUB_SHA.Substring(0, 8)
25+
}
26+
"version=$version" >> $env:GITHUB_OUTPUT
1627
- name: Install Vulkan SDK
1728
uses: jakoch/install-vulkan-sdk-action@v1.6.0
1829
with:
@@ -40,3 +51,34 @@ jobs:
4051
Windows\VisualStudio\Build-vkQuake\**\*.exe
4152
Windows\VisualStudio\Build-vkQuake\**\*.dll
4253
Windows\VisualStudio\Build-vkQuake\**\vkQuake.pdb
54+
- name: Package
55+
if: matrix.configuration == 'Release'
56+
run: |
57+
$version = '${{ steps.version.outputs.version }}'
58+
$srcdir = 'Windows\VisualStudio\Build-vkQuake\${{ matrix.platform }}\Release'
59+
$compress = @{
60+
Path = "$srcdir\*.exe", "$srcdir\vkQuake.pdb", "$srcdir\*.dll", 'LICENSE.txt'
61+
CompressionLevel = 'Optimal'
62+
DestinationPath = "Packaging\Windows\vkQuake-${version}_windows_${{ matrix.platform }}.zip"
63+
}
64+
Compress-Archive @compress
65+
choco install nsis -y --no-progress
66+
Set-Location Packaging\Windows
67+
& makensis -V4 '-DSRCDIR=..\..\Windows\VisualStudio\Build-vkQuake\${{ matrix.platform }}\Release' '-DPLATFORM=windows_${{ matrix.platform }}' "-DVERSION=$version" vkQuake.nsi
68+
if (-not $?) { throw "makensis failed" }
69+
- name: Upload package
70+
if: matrix.configuration == 'Release'
71+
uses: actions/upload-artifact@v7
72+
with:
73+
name: vkQuake package (${{ matrix.platform }})
74+
path: |
75+
Packaging\Windows\vkQuake-*.zip
76+
Packaging\Windows\vkQuake-Installer-*.exe
77+
- name: Attach to release
78+
if: matrix.configuration == 'Release' && startsWith(github.ref, 'refs/tags/')
79+
uses: softprops/action-gh-release@v2
80+
with:
81+
draft: true
82+
files: |
83+
Packaging/Windows/vkQuake-*.zip
84+
Packaging/Windows/vkQuake-Installer-*.exe

0 commit comments

Comments
 (0)