Repository navigation
389 lines (389 loc) · 16.8 KB
/
Copy pathnative-release.yml
File metadata and controls
389 lines (389 loc) · 16.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
name: Native release
on:
push:
branches: ["native"]
tags: ["v*"]
paths:
- "VERSION"
- ".github/workflows/native-release.yml"
- ".github/scripts/**"
- "CMakeLists.txt"
- "native/**"
- "LICENSE"
- "NOTICE"
workflow_dispatch:
env:
HOMEBREW_NO_AUTO_UPDATE: "1"
ZERO_AR_DATE: "1"
permissions:
contents: read
concurrency:
# Branch rehearsals never publish and must not block newer commits. Keep
# same-tag publication serialized, including reruns and manual dispatch.
group: native-release-${{ github.ref }}-${{ startsWith(github.ref, 'refs/tags/') && 'publication' || github.sha }}
cancel-in-progress: false
jobs:
signing-credentials:
if: startsWith(github.ref, 'refs/tags/') || vars.KALANDRA_NOTARIZE == 'true'
runs-on: macos-26
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.14"
- name: Validate publisher credentials without a release build
env:
KALANDRA_SIGNING_P12_BASE64: ${{ secrets.KALANDRA_SIGNING_P12_BASE64 }}
KALANDRA_SIGNING_P12_PASSWORD: ${{ secrets.KALANDRA_SIGNING_P12_PASSWORD }}
KALANDRA_APPLE_ID: ${{ secrets.KALANDRA_APPLE_ID }}
KALANDRA_APPLE_APP_PASSWORD: ${{ secrets.KALANDRA_APPLE_APP_PASSWORD }}
KALANDRA_APPLE_TEAM_ID: ${{ vars.KALANDRA_APPLE_TEAM_ID }}
KALANDRA_SIGNING_IDENTITY: ${{ vars.KALANDRA_SIGNING_IDENTITY }}
run: python3 .github/scripts/notarize_native.py --check-only
- name: Remove temporary signing credentials
if: always()
run: |
security delete-keychain "$RUNNER_TEMP/kalandra-signing/signing.keychain-db" 2>/dev/null || true
rm -rf "$RUNNER_TEMP/kalandra-signing"
build:
runs-on: macos-26
# Source, reproducibility and relocated-package checks share this job.
# Keep individual test deadlines intact; allow the complete suite to finish.
timeout-minutes: 90
env:
DEVELOPER_DIR: /Applications/Xcode_26.2.app/Contents/Developer
outputs:
tag: ${{ steps.version.outputs.tag }}
prerelease: ${{ steps.version.outputs.prerelease }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.14"
- name: Validate release classifier
run: python3 -m unittest discover -s .github/scripts -p 'test_*.py'
- name: Classify version tag
id: version
if: startsWith(github.ref, 'refs/tags/')
env:
RELEASE_TAG: ${{ github.ref_name }}
run: python3 .github/scripts/release_version.py
- name: Install native dependencies
run: |
brew update
brew install cmake ninja tomlplusplus zstd z3
brew upgrade zstd z3
- name: Install verified pinned LLVM bottle
run: python3 .github/scripts/provision_native_llvm.py --install --directory "$RUNNER_TEMP/pinned-llvm"
- name: Build verified host cross linkers
run: python3 .github/scripts/provision_cross_lld.py --llvm "$KALANDRA_LLVM_ROOT" --directory "$RUNNER_TEMP/cross-lld"
- name: Install verified pinned Metal translation tools
run: python3 .github/scripts/provision_native_metal.py
- name: Configure mixed CPU/Metal toolchain
run: >-
cmake -S . -B build/native -G Ninja
-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON
-DKALANDRA_LLVM_ROOT="$KALANDRA_LLVM_ROOT"
-DCMAKE_OSX_DEPLOYMENT_TARGET=26.0
-DKALANDRA_SPIRV_CROSS_ROOT="$KALANDRA_SPIRV_CROSS_ROOT"
-DKALANDRA_SPIRV_TOOLS_ROOT="$KALANDRA_SPIRV_TOOLS_ROOT"
-DKALANDRA_METAL_COMPILER="$KALANDRA_METAL_COMPILER"
-DKALANDRA_BUILD_METAL_RUNTIME=ON -DKALANDRA_BUILD_METAL_PROOF=ON
- name: Build release packages
run: >-
cmake --build build/native --target kalandra kalandra-test-observer native-cpu-package native-editor-tools-package
native-cpu-standalone-package native-editor-tools-standalone-package
native-metal-package native-metal-standalone-package -j4
- name: Qualify cooperative workgroup source and safety proofs
run: |
cmake --build build/native --target native-workgroup-qualification -j4
ctest --test-dir build/native --output-on-failure -j4 -R '^frontend-workgroup-'
- name: Qualify application entries, console I/O and formatting
run: |
cmake --build build/native --target native-io-qualification -j4
ctest --test-dir build/native --output-on-failure -j4 -L '^feature-io$' -LE '^feature-gpu$'
- name: Qualify explicit returns and primitive types
run: >-
ctest --test-dir build/native --output-on-failure
-R '^native-explicit-returns$'
- name: Qualify iterator contracts and source generators
run: |
cmake --build build/native --target native-iterator-qualification -j4
ctest --test-dir build/native --output-on-failure -j4 \
-R '^(frontend-iterator-(contracts|fusion)-|native-((iterators|generator)-source-|iterator-fusion-))'
- name: Qualify checked recursive calls and signed remainder
run: |
cmake --build build/native --target kalandra-checked-inlining-tests -j4
ctest --test-dir build/native --output-on-failure -j4 \
-R '^native-(checked-inlining(-source(-float32)?-(hardware|software))?|call-foundation-source|windows-tail-codegen|recursive-scalars|signed-remainder|tail-calls(-software)?|fast-calls)$'
- name: Qualify CPU tensor transforms
run: >-
python3 native/tests/TensorTransformTests.py
--compiler build/native/native/kalandra-test-observer --clang "$KALANDRA_LLVM_ROOT/bin/clang++"
--output build/native/tensor-transforms --quick
- name: Qualify arithmetic policy, benchmark references and MIT provenance
run: >-
ctest --test-dir build/native --output-on-failure -j4
-R '^native-(arithmetic-policy|fair-benchmark-evidence|steel-vendor-license)$'
- name: Qualify opaque synchronous task ownership
run: |
cmake --build build/native --target kalandra-closed-task-tests-optimized -j4
ctest --test-dir build/native --output-on-failure -R '^native-closed-tasks-optimized$'
- name: Remove archive staging copies before the independent build
run: |
python3 - <<'PY'
from pathlib import Path
import shutil
for stage in Path("build/native").glob("native-*/package-stage"):
shutil.rmtree(stage)
PY
- name: Independently rebuild standalone distributions
run: |
cmake -S . -B build/native-repro -G Ninja \
-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \
-DKALANDRA_LLVM_ROOT="$KALANDRA_LLVM_ROOT" \
-DCMAKE_OSX_DEPLOYMENT_TARGET=26.0 \
-DKALANDRA_SPIRV_CROSS_ROOT="$KALANDRA_SPIRV_CROSS_ROOT" \
-DKALANDRA_SPIRV_TOOLS_ROOT="$KALANDRA_SPIRV_TOOLS_ROOT" \
-DKALANDRA_METAL_COMPILER="$KALANDRA_METAL_COMPILER" \
-DKALANDRA_BUILD_METAL_RUNTIME=ON -DKALANDRA_BUILD_METAL_PROOF=ON
cmake --build build/native-repro --target native-cpu-standalone-package \
native-editor-tools-standalone-package native-metal-standalone-package -j4
python3 - <<'PY'
from pathlib import Path
import shutil
for stage in Path("build/native-repro").glob("native-*/package-stage"):
shutil.rmtree(stage)
PY
python3 native/packaging/CompareDistributions.py build/native build/native-repro
- name: Qualify installed and relocated packages
run: >-
ctest --test-dir build/native
-R '^native-((cpu|editor-tools)-install|standalone-.*|distribution-archive)$' --output-on-failure
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.12"
- name: Build and test editor package
working-directory: native/editor/vscode
run: |
bun install --frozen-lockfile
bun test
bun run package
- name: Assemble release assets
run: |
mkdir release-assets
cp build/native/native-cpu/*.tar.gz* release-assets/
cp build/native/native-editor-tools/*.tar.gz* release-assets/
cp build/native/native-cpu-standalone/*.tar.gz* release-assets/
cp build/native/native-editor-tools-standalone/*.tar.gz* release-assets/
cp build/native/native-metal/*.tar.gz* release-assets/
cp build/native/native-metal-standalone/*.tar.gz* release-assets/
cp build/native/editor/kalandra-native.vsix release-assets/
cd release-assets
shasum -a 256 kalandra-native.vsix > kalandra-native.vsix.sha256
- uses: actions/upload-artifact@v4
with:
name: native-release-assets
path: release-assets/*
if-no-files-found: error
bundle-targets:
permissions:
contents: read
actions: read
needs: build
runs-on: ubuntu-24.04
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.14"
- uses: actions/download-artifact@v4
with:
name: native-release-assets
path: release-assets
- name: Collect qualified platform runtimes and assemble host downloads
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
RELEASE_TAG: ${{ needs.build.outputs.tag }}
run: python3 .github/scripts/bundle_release_targets.py
- uses: actions/upload-artifact@v4
with:
name: native-bundled-release-assets
path: release-assets/*
if-no-files-found: error
qualify-standalone:
needs: bundle-targets
runs-on: macos-26
timeout-minutes: 30
env:
DEVELOPER_DIR: /Applications/Xcode_26.2.app/Contents/Developer
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.14"
- uses: actions/download-artifact@v4
with:
name: native-bundled-release-assets
path: release-assets
# This job intentionally performs no Homebrew/LLVM installation or native build.
- name: Install Apple platform Metal component
run: xcodebuild -downloadComponent MetalToolchain
- name: Qualify downloaded standalone editor tools
run: >-
python3 native/packaging/StandaloneTests.py --kind editor
--archive release-assets/kalandra-native-editor-tools-standalone-macos-arm64.tar.gz
- name: Qualify downloaded standalone CPU compiler
run: >-
python3 native/packaging/StandaloneTests.py --kind cpu
--archive release-assets/kalandra-native-cpu-standalone-macos-arm64.tar.gz
- name: Qualify downloaded mixed CPU/Metal compiler
run: >-
python3 native/packaging/StandaloneTests.py --kind metal
--archive release-assets/kalandra-native-metal-standalone-macos-arm64.tar.gz
qualify-vulkan:
needs: bundle-targets
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.14"
- uses: actions/download-artifact@v4
with:
name: native-bundled-release-assets
path: release-assets
# This job does not claim hardware execution on a standard hosted runner.
- name: Qualify downloaded combined Linux CPU Vulkan compiler
run: >-
python3 native/vulkan/qualification/installed.py --bundled-targets
--archive release-assets/kalandra-native-vulkan-standalone-linux-x86_64.tar.gz
--root build/vulkan-release-qualification
qualify-cuda:
needs: bundle-targets
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.14"
- uses: actions/download-artifact@v4
with:
name: native-bundled-release-assets
path: release-assets
# This job does not claim hardware execution on a standard hosted runner.
- name: Qualify downloaded combined Linux CPU CUDA and multi-backend GPU compilers
run: |
python3 native/cuda-source/qualification/installed.py --bundled-targets \
--archive release-assets/kalandra-native-cuda-standalone-linux-x86_64.tar.gz \
--root build/cuda-release-qualification
python3 native/gpu-bundle/installed.py --bundled-targets \
--archive release-assets/kalandra-native-gpu-standalone-linux-x86_64.tar.gz \
--root build/gpu-release-qualification
qualify-windows-gpu:
needs: bundle-targets
strategy:
fail-fast: false
matrix:
include:
- runner: windows-2025
arch: x86_64
msvc: x64
- runner: windows-11-arm
arch: arm64
msvc: arm64
runs-on: ${{ matrix.runner }}
timeout-minutes: 90
defaults:
run:
shell: pwsh
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.14'
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.msvc }}
- uses: actions/download-artifact@v4
with:
name: native-bundled-release-assets
path: release-assets
- name: Qualify final experimental Windows CUDA, Vulkan and multi-backend GPU archives
run: |
foreach ($backend in @('cuda', 'vulkan', 'gpu')) {
python native/gpu-runtime/qualification/windows_installed.py --backend $backend --bundled-targets --archive "release-assets/kalandra-native-$backend-standalone-windows-${{ matrix.arch }}.tar.gz" --root "build/release-$backend" --arch ${{ matrix.arch }} --jobs 2
if ($LASTEXITCODE -ne 0) { throw "$backend released Windows package qualification failed" }
}
notarize:
if: startsWith(github.ref, 'refs/tags/') || vars.KALANDRA_NOTARIZE == 'true'
needs: [build, bundle-targets, qualify-standalone, signing-credentials]
runs-on: macos-26
timeout-minutes: 60
env:
DEVELOPER_DIR: /Applications/Xcode_26.2.app/Contents/Developer
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.14"
- uses: actions/download-artifact@v4
with:
name: native-bundled-release-assets
path: release-assets
- name: Install Apple platform Metal component
run: xcodebuild -downloadComponent MetalToolchain
- name: Sign, notarize, staple and assess standalone distributions
env:
KALANDRA_SIGNING_P12_BASE64: ${{ secrets.KALANDRA_SIGNING_P12_BASE64 }}
KALANDRA_SIGNING_P12_PASSWORD: ${{ secrets.KALANDRA_SIGNING_P12_PASSWORD }}
KALANDRA_APPLE_ID: ${{ secrets.KALANDRA_APPLE_ID }}
KALANDRA_APPLE_APP_PASSWORD: ${{ secrets.KALANDRA_APPLE_APP_PASSWORD }}
KALANDRA_APPLE_TEAM_ID: ${{ vars.KALANDRA_APPLE_TEAM_ID }}
KALANDRA_SIGNING_IDENTITY: ${{ vars.KALANDRA_SIGNING_IDENTITY }}
run: python3 .github/scripts/notarize_native.py
- name: Remove temporary signing credentials
if: always()
run: |
security delete-keychain "$RUNNER_TEMP/kalandra-signing/signing.keychain-db" 2>/dev/null || true
rm -rf "$RUNNER_TEMP/kalandra-signing"
- uses: actions/upload-artifact@v4
with:
name: native-notarized-assets
path: signed-assets/**/*
if-no-files-found: error
publish:
if: startsWith(github.ref, 'refs/tags/')
needs: [build, bundle-targets, qualify-standalone, qualify-vulkan, qualify-cuda, qualify-windows-gpu, notarize]
runs-on: ubuntu-latest
permissions:
contents: write
actions: read
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: native-bundled-release-assets
path: release-assets
- uses: actions/download-artifact@v4
with:
name: native-notarized-assets
path: signed-assets
- name: Require exact-tag bundled cross-platform qualification
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
RELEASE_TAG: ${{ needs.build.outputs.tag }}
run: python3 .github/scripts/require_cross_qualification.py
- name: Create draft, upload assets, then publish
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
RELEASE_TAG: ${{ needs.build.outputs.tag }}
RELEASE_PRERELEASE: ${{ needs.build.outputs.prerelease }}
run: python3 .github/scripts/publish_native_release.py