Skip to content

Commit 3a6a02d

Browse files
committed
ci: build and publish the Windows installer on version tags
New release-windows workflow: provisions the CUDA sub-packages needed for the CUDA device runtime, builds via setup.ps1 with IGNIS.BUILD_INSTALLER, runs the test suite, uploads the NSIS installer as an artifact and attaches it to the GitHub release on v* tags. Also runnable manually via workflow_dispatch.
1 parent 7df86e0 commit 3a6a02d

1 file changed

Lines changed: 95 additions & 0 deletions

File tree

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Release Windows
2+
3+
on:
4+
push:
5+
tags: [ "v*" ]
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
installer:
14+
15+
runs-on: windows-latest
16+
permissions:
17+
contents: write
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v7
22+
23+
# The CUDA toolkit is needed so the installer ships the CUDA device
24+
# runtime (runtime_cuda + bundled nvrtc/nvvm). A network install with
25+
# just the required sub-packages keeps this reasonably small: nvcc
26+
# carries libnvvm, cudart the driver stub, nvrtc the runtime compiler.
27+
- name: Setup CUDA toolkit
28+
uses: Jimver/cuda-toolkit@v0.2.35
29+
with:
30+
cuda: "13.2.0"
31+
method: network
32+
sub-packages: '["nvcc", "cudart", "nvrtc", "nvrtc_dev"]'
33+
34+
- name: Setup sccache
35+
uses: hendrikmuhs/ccache-action@v1.2
36+
with:
37+
variant: sccache
38+
key: ${{ github.job }}-${{ runner.os }}
39+
max-size: 2G
40+
41+
- name: Cache AnyDSL toolchain (thorin/artic/runtime)
42+
uses: actions/cache@v4
43+
with:
44+
path: deps
45+
key: anydsl-deps-${{ runner.os }}-${{ hashFiles('scripts/setup/config.json', 'scripts/setup/*.ps1') }}
46+
restore-keys: |
47+
anydsl-deps-${{ runner.os }}-
48+
49+
- name: Cache CPM sources
50+
uses: actions/cache@v4
51+
with:
52+
path: .cpm-cache
53+
key: cpm-${{ runner.os }}-${{ hashFiles('cmake/Dependencies.cmake') }}
54+
restore-keys: |
55+
cpm-${{ runner.os }}-
56+
57+
- name: Generate release setup config
58+
shell: pwsh
59+
run: |
60+
$cfg = Get-Content scripts/setup/config.json -Raw | ConvertFrom-Json
61+
# Keep the dependency tree inside the workspace so it can be cached.
62+
$cfg.LOCATION = "$env:GITHUB_WORKSPACE/deps"
63+
$cfg.CMAKE.EXTRA_ARGS += "-DCMAKE_C_COMPILER_LAUNCHER=sccache"
64+
$cfg.CMAKE.EXTRA_ARGS += "-DCMAKE_CXX_COMPILER_LAUNCHER=sccache"
65+
# zlib ships in the prebuilt LLVM env (LLVM.PREBUILT_PACKAGES), so skip
66+
# the flaky from-source build; setup_llvm.ps1 puts the env on
67+
# CMAKE_PREFIX_PATH and Ignis resolves it from there.
68+
$cfg.ZLIB.ENABLED = $false
69+
# Have setup_ignis.ps1 run cpack -G NSIS after the build.
70+
$cfg.IGNIS.BUILD_INSTALLER = $true
71+
$cfg | ConvertTo-Json -Depth 16 | Set-Content scripts/setup/config.ci.json
72+
73+
- name: Setup dependencies, build Ignis and package installer
74+
shell: pwsh
75+
run: |
76+
$env:CPM_SOURCE_CACHE = "$env:GITHUB_WORKSPACE/.cpm-cache"
77+
./scripts/setup/setup.ps1 -config_file scripts/setup/config.ci.json
78+
79+
- name: Run tests
80+
shell: pwsh
81+
run: ctest --test-dir build/Release --output-on-failure -E "(ignis_test_integrator)|(ignis_test_multiple_runtimes)"
82+
83+
- name: Upload installer artifact
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: ignis-installer-win64
87+
path: build/Release/Ignis-*-win64.exe
88+
if-no-files-found: error
89+
90+
- name: Attach installer to GitHub release
91+
if: startsWith(github.ref, 'refs/tags/')
92+
uses: softprops/action-gh-release@v2
93+
with:
94+
files: build/Release/Ignis-*-win64.exe
95+
generate_release_notes: true

0 commit comments

Comments
 (0)