|
6 | 6 | build-windows: |
7 | 7 | name: Build Windows |
8 | 8 | runs-on: windows-2025-vs2026 |
| 9 | + permissions: |
| 10 | + contents: write |
9 | 11 | strategy: |
10 | 12 | fail-fast: false |
11 | 13 | matrix: |
12 | 14 | configuration: [Release, Debug] |
13 | 15 | platform: [x64] |
14 | 16 | steps: |
15 | 17 | - 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 |
16 | 27 | - name: Install Vulkan SDK |
17 | 28 | uses: jakoch/install-vulkan-sdk-action@v1.6.0 |
18 | 29 | with: |
|
40 | 51 | Windows\VisualStudio\Build-vkQuake\**\*.exe |
41 | 52 | Windows\VisualStudio\Build-vkQuake\**\*.dll |
42 | 53 | 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