Repository navigation
471 lines (465 loc) · 26.5 KB
/
Copy pathrelease.yml
File metadata and controls
471 lines (465 loc) · 26.5 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
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
# A release, built here where anyone can read how (public #6; docs/public-first.feature PF5): for a v* tag, macOS on
# Apple Silicon, Linux on x86_64 and Windows on x86_64 are built from the tag on GitHub's runners, packed by
# tools/release.sh, checked by tools/release-check.sh, attested (anyone can check a download with
# `gh attestation verify raea-VERSION-macos-arm64.tar.gz -R shinyobjectz/raea`) and attached to the tag's release.
# The skills gate reads the feed app, which is private, so it runs in a maintainer's checkout first
# (tools/skills.sh check), and the tag names the commit it passed on; tools/release.sh checks the gate's inputs haven't
# changed since (tools/release/skills-passed.sh):
# git tag -a v0.1.0 -m "raea 0.1.0" -m "skills-passed: <full sha>"
# A tag with a suffix (v0.1.0-rc1, v0.1.0-canary.3) is made a pre-release; a plain version (v0.1.0) is a full release,
# GitHub's latest. The release's notes are set by hand.
# A release whose code is a candidate's is promoted, not compiled again (tools/release/promoted-from.sh: the tag's
# "promoted-from: v0.1.0-rc5" line, which tools/agents/release-go.sh writes): each job takes the candidate's attested
# binaries for its platform (tools/release/promoted-bins.sh) and packs, checks, attests and attaches them as the
# release, in minutes instead of the three hours a cold build takes. Run by hand, dry_run packs and checks without
# attesting or attaching (the archives are the run's artifacts), for trying a promote before the real one.
name: release
on:
push:
tags: ["v*"]
workflow_dispatch:
inputs:
tag:
description: the tag to build (v0.1.0)
required: true
type: string
skills_passed:
description: the full SHA where tools/skills.sh check passed with the feed app (else the tag's skills-passed line)
default: ""
type: string
promote_from:
description: a candidate tag (v0.1.0-rc5) whose binaries this release is, else the tag's promoted-from line; none builds from source
default: ""
type: string
dry_run:
description: pack and check only; nothing attested or attached (the archives are this run's artifacts)
default: false
type: boolean
permissions:
contents: write
id-token: write
attestations: write
env:
CARGO_TERM_COLOR: never
CARGO_INCREMENTAL: "0"
TAG: ${{ inputs.tag || github.ref_name }}
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: macos-15
lib: libraea_bundle.dylib
extra: raea-perceive
# raea-perceive (`raea song`'s map) builds off Apple since #43
- os: ubuntu-24.04
lib: libraea_bundle.so
extra: raea-perceive
# a faster runner when the repo names one: vars RELEASE_MAC_RUNNER, RELEASE_LINUX_RUNNER, RELEASE_WINDOWS_RUNNER hold
# a JSON list of runs-on labels (Namespace's: a machine and a cache volume); else GitHub's
# own, a 3-core M1 with 7 GB on the Mac, where a cold build took 3 hours
runs-on: ${{ (matrix.os == 'macos-15' && vars.RELEASE_MAC_RUNNER && fromJSON(vars.RELEASE_MAC_RUNNER)) || (matrix.os == 'ubuntu-24.04' && vars.RELEASE_LINUX_RUNNER && fromJSON(vars.RELEASE_LINUX_RUNNER)) || matrix.os }}
# a cold thin-LTO build of raea-cli with the plugin catalog is the long part; GitHub's own limit is 6 hours
timeout-minutes: 340
env:
# the compile cache (the "Compile cache" step): an R2 bucket, read and written by every build
RELEASE_CACHE_ENDPOINT: ${{ secrets.RELEASE_CACHE_ENDPOINT }}
AWS_ACCESS_KEY_ID: ${{ secrets.RELEASE_CACHE_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.RELEASE_CACHE_SECRET }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.TAG }}
submodules: true
lfs: false
- name: Promoted from a candidate, or built (tools/release/promoted-from.sh)
env:
GH_TOKEN: ${{ github.token }}
run: bash tools/release/promoted-from.sh "$TAG" "${{ inputs.promote_from }}"
- name: Linux libraries
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y cmake ninja-build nasm libxkbcommon-dev libxkbcommon-x11-dev libasound2-dev libfontconfig1-dev libvulkan-dev libudev-dev mesa-vulkan-drivers xvfb
- name: macOS tools
if: runner.os == 'macOS'
run: brew install cmake ninja
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.2
- name: The runtime's packages
run: for d in sdk/react/js sdk/react/tw; do (cd "$d" && bun install --frozen-lockfile); done
- name: Models (pinned by URL and sha256 in tools/release/models.tsv)
run: |
while IFS=$'\t' read -r path url sha; do
case $path in ''|'#'*) continue ;; esac
mkdir -p "$HOME/.local/share/raea-models/$(dirname "$path")"
curl -fsSL "$url" -o "$HOME/.local/share/raea-models/$path"
echo "$sha $HOME/.local/share/raea-models/$path" | shasum -a 256 -c -
done < tools/release/models.tsv
# rc3's build left 576 MB of macos-15's 320 GB free, and rc4's dSYMs (#88) ran it out linking raea-page-host
# (ld: write() failed, errno=28): the image's other Xcodes and the Android and .NET SDKs go first
- name: Room for the build
if: runner.os == 'macOS' && env.RAEA_PROMOTED_FROM == '' && vars.RELEASE_MAC_RUNNER == ''
run: |
df -h . | tail -1
keep=$(cd "$(xcode-select -p)/../.." && pwd -P)
for x in /Applications/Xcode*.app; do [ -L "$x" ] || [ "$(cd "$x" && pwd -P)" = "$keep" ] || sudo rm -rf "$x" & done
sudo rm -rf "$HOME/Library/Android" "$HOME/.dotnet" /usr/local/share/dotnet &
wait
echo "kept $keep"
df -h . | tail -1
# The compile cache: sccache on an R2 bucket. GitHub's own cache can't carry a release build: a tag's run reads
# only its own tag's caches and the default branch's (so rc3's never reached rc4), and the repo's 10 GB are CI's.
# A bucket is read by every tag. A cold build fills it; a candidate after a small change compiles only the crates
# that changed and the ones above them. Linking (thin LTO) and build scripts' runs aren't cached. With no secrets
# (a fork) the build runs as before, uncached.
# the build folder and cargo's downloads kept between runs on the runner's cache volume (a Namespace runner,
# whose labels attach one), so a candidate rebuilds only what changed and links;
# sccache below still serves the workspace's own crates, which a fresh checkout's file times mark as changed
- name: The build folder, kept on the runner's cache volume
if: env.RAEA_PROMOTED_FROM == '' && startsWith(runner.name, 'nsc-')
uses: namespacelabs/nscloud-cache-action@v1
with:
path: |
${{ github.workspace }}/target
~/.cargo/registry
~/.cargo/git
- name: Compile cache (sccache)
if: env.RAEA_PROMOTED_FROM == '' && env.AWS_ACCESS_KEY_ID != ''
uses: mozilla-actions/sccache-action@v0.0.9
# the script from this workflow's own commit: a dispatched run (a dry run that fills the cache) builds an older
# tag, whose tree may not have it
- name: The compile cache's script
if: env.RAEA_PROMOTED_FROM == '' && env.AWS_ACCESS_KEY_ID != ''
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
path: .workflow
sparse-checkout: tools/release/compile-cache.sh
sparse-checkout-cone-mode: false
- name: Use the compile cache
if: env.RAEA_PROMOTED_FROM == '' && env.AWS_ACCESS_KEY_ID != ''
run: bash .workflow/tools/release/compile-cache.sh
- name: Build
if: env.RAEA_PROMOTED_FROM == ''
run: |
feat=$(bash tools/bevy-plugins.sh features sdk/raea/bench/bevy-plugins)
t() { s=$SECONDS; "$@"; echo "::notice::${{ runner.os }} $(( (SECONDS - s) / 60 )) min: ${*:7}"; }
t cargo build --profile dist --locked -p raea-cli --bin raea --no-default-features --features "$feat"
t cargo build --profile dist --locked -p raea-rune-host
t cargo build --profile dist --locked -p raea-page-host --features window
if [ -n "${{ matrix.extra }}" ]; then t cargo build --profile dist --locked -p ${{ matrix.extra }}; fi
if [ -n "${RUSTC_WRAPPER:-}" ]; then sccache --show-stats; fi
mkdir ship
cp target/dist/raea target/dist/${{ matrix.lib }} target/dist/raea-rune-host target/dist/raea-page-host ship/
if [ -n "${{ matrix.extra }}" ]; then cp target/dist/${{ matrix.extra }} ship/; fi
# the Mac's dSYMs (tools/link-jit.sh made them as it stripped each binary, #88); release.sh keeps them
if [ -d target/dist/symbols ]; then cp -R target/dist/symbols ship/; fi
- name: The candidate's binaries (tools/release/promoted-bins.sh)
if: env.RAEA_PROMOTED_FROM != ''
env:
GH_TOKEN: ${{ github.token }}
run: bash tools/release/promoted-bins.sh "$RAEA_PROMOTED_FROM" ship
# the packing and its checks need only ship/, and macos-15's disk ran out packing rc1 with target/ kept
- name: Free the build's disk
# not the cache volume's build folder, which the next candidate starts from (a bind mount on Linux)
if: ${{ !startsWith(runner.name, 'nsc-') }}
run: |
df -h . | tail -1
rm -rf target
df -h . | tail -1
- name: Where the skills gate passed
run: bash tools/release/skills-passed.sh "$TAG" "${{ inputs.skills_passed }}"
- name: Pack and check (tools/release.sh)
env:
RAEA_CHECK_DIR: ${{ runner.temp }}/release-check
run: |
v=${TAG#v}
if [ "$RUNNER_OS" = Linux ]; then xvfb-run -a -s "-screen 0 1280x1024x24" bash tools/release.sh "$v" ship HEAD
else bash tools/release.sh "$v" ship HEAD; fi
# a failed check's own files (the app check's frames, every step's log), not the unpacked release
- uses: actions/upload-artifact@v4
if: failure()
with:
name: release-check-${{ runner.os }}
path: |
${{ runner.temp }}/release-check/app
${{ runner.temp }}/release-check/**/*.log
retention-days: 7
if-no-files-found: ignore
# the stripped binaries' symbols (#88), for symbolicating a crash report from this release; never published
- uses: actions/upload-artifact@v4
with:
name: symbols-${{ runner.os }}
path: dist/raea-*-symbols
retention-days: 90
if-no-files-found: warn
- uses: actions/attest-build-provenance@v2
if: ${{ !inputs.dry_run }}
with:
subject-path: dist/raea-*.tar.gz
- name: Attach to the release
if: ${{ !inputs.dry_run }}
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release view "$TAG" >/dev/null 2>&1 || gh release create "$TAG" ${{ contains(env.TAG, '-') && '--prerelease' || '' }} --title "raea ${TAG#v}" --notes "Built by .github/workflows/release.yml; notes follow."
gh release upload "$TAG" dist/raea-*.tar.gz dist/raea-*.tar.gz.sha256 --clobber
- uses: actions/upload-artifact@v4
if: ${{ inputs.dry_run }}
with:
name: dry-run-${{ runner.os }}
path: dist/raea-*.tar.gz*
retention-days: 3
compression-level: 0
# Windows in Git's bash on GitHub's runner, with Visual Studio in its image. The C runtime is the DLL one: ONNX
# Runtime is built against it (crt-static didn't link: LNK2019 on __imp_ symbols, 10-29), and Microsoft's
# onnxruntime.dll imports it too, so the VC++ runtime's DLLs ship beside raea.exe from this image's Visual Studio
# (tools/release/win-bundle.sh), as Microsoft documents for app-local deployment.
windows:
runs-on: ${{ (vars.RELEASE_WINDOWS_RUNNER && fromJSON(vars.RELEASE_WINDOWS_RUNNER)) || 'windows-latest' }}
timeout-minutes: 350
env:
# the compile cache, as build's
RELEASE_CACHE_ENDPOINT: ${{ secrets.RELEASE_CACHE_ENDPOINT }}
AWS_ACCESS_KEY_ID: ${{ secrets.RELEASE_CACHE_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.RELEASE_CACHE_SECRET }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.TAG }}
submodules: true
lfs: false
- name: Promoted from a candidate, or built (tools/release/promoted-from.sh)
env:
GH_TOKEN: ${{ github.token }}
run: bash tools/release/promoted-from.sh "$TAG" "${{ inputs.promote_from }}"
- name: Toolchain (rust-toolchain.toml's pin)
if: env.RAEA_PROMOTED_FROM == ''
run: rustup show active-toolchain || rustup toolchain install
# nasm, which rav1d's and openh264-sys2's build scripts run: GitHub's Windows image has 2.16, Namespace's has none
# (rc3's dry run there stopped at "Unable to run nasm: program not found"). Always NASM's own 2.16.03 zip, never
# Chocolatey's: rc4 took Chocolatey's newest, and raea.exe failed to link 135 of openh264's SIMD routines
# (WelsSampleSad16x8_sse2 and the rest unresolved) though openh264's C++ was built to call them
- name: nasm
if: env.RAEA_PROMOTED_FROM == ''
run: |
v=2.16.03
curl -fsSL --retry 3 -o "$RUNNER_TEMP/nasm.zip" "https://www.nasm.us/pub/nasm/releasebuilds/$v/win64/nasm-$v-win64.zip"
unzip -q "$RUNNER_TEMP/nasm.zip" -d "$RUNNER_TEMP"
# Git Bash on Windows has no /dev/stderr (rc5 stopped here): capture, print, then match
out=$("$RUNNER_TEMP/nasm-$v/nasm.exe" -v)
echo "$out"
case $out in *"version $v"*) ;; *) echo "::error::expected NASM $v, got: $out"; exit 1 ;; esac
echo "$RUNNER_TEMP/nasm-$v" >> "$GITHUB_PATH"
# jq for Windows ends -r lines with CRLF, so tools/bevy-plugins.sh read "ahoy\r" and lost its Bevy 0.20 block
# (feature `ahoy` not found, 11-04); -b writes LF
- name: jq that writes LF
run: |
mkdir -p "$RUNNER_TEMP/jq"
printf '#!/bin/bash\nexec "%s" -b "$@"\n' "$(command -v jq)" > "$RUNNER_TEMP/jq/jq"
chmod +x "$RUNNER_TEMP/jq/jq"
echo "$RUNNER_TEMP/jq" >> "$GITHUB_PATH"
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.2
- name: The runtime's packages
run: for d in sdk/react/js sdk/react/tw; do (cd "$d" && bun install --frozen-lockfile); done
# `raea song`'s beat model, which release.sh packs (into Git bash's ~/.local/share/raea-models, as on the others)
- name: Models (pinned by URL and sha256 in tools/release/models.tsv)
run: |
while IFS=$'\t' read -r path url sha; do
case $path in ''|'#'*) continue ;; esac
mkdir -p "$HOME/.local/share/raea-models/$(dirname "$path")"
curl -fsSL "$url" -o "$HOME/.local/share/raea-models/$path"
echo "$sha $HOME/.local/share/raea-models/$path" | sha256sum -c -
done < <(tr -d '\r' < tools/release/models.tsv)
# the app targets' hosts a cargo call each: with raea-cli's crates in one call taffy's features unify and
# rune-taffy doesn't build; raea-perceive (`raea song`'s map, #43) a call of its own too
- name: The build folder, kept on the runner's cache volume (as build's)
if: env.RAEA_PROMOTED_FROM == '' && startsWith(runner.name, 'nsc-')
uses: namespacelabs/nscloud-cache-action@v1
with:
path: |
${{ github.workspace }}/target
~/.cargo/registry
~/.cargo/git
- name: Compile cache (sccache, as build's)
if: env.RAEA_PROMOTED_FROM == '' && env.AWS_ACCESS_KEY_ID != ''
uses: mozilla-actions/sccache-action@v0.0.9
# the script from this workflow's own commit: a dispatched run (a dry run that fills the cache) builds an older
# tag, whose tree may not have it
- name: The compile cache's script
if: env.RAEA_PROMOTED_FROM == '' && env.AWS_ACCESS_KEY_ID != ''
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
path: .workflow
sparse-checkout: tools/release/compile-cache.sh
sparse-checkout-cone-mode: false
- name: Use the compile cache
if: env.RAEA_PROMOTED_FROM == '' && env.AWS_ACCESS_KEY_ID != ''
run: bash .workflow/tools/release/compile-cache.sh
# openh264-sys2 is built here every time, never taken whole from the cache volume's target/: a build of it whose
# assembly didn't make it into the rlib (0.1.3-rc4's Chocolatey nasm) stays fresh to cargo on a restored target/,
# and every link after it fails on the same 135 SIMD routines (v0.1.4-rc1, 11-14: only raea-cli compiled, then
# WaverageChromaFilter8_sse2 and the rest unresolved). Its C++ comes back from sccache; the assembly is seconds
- name: openh264 built here, not restored
if: env.RAEA_PROMOTED_FROM == ''
run: rm -rf target/dist/build/openh264-sys2-* target/dist/deps/libopenh264_sys2-* target/dist/.fingerprint/openh264-sys2-*
- name: Build
if: env.RAEA_PROMOTED_FROM == ''
run: |
feat=$(bash tools/bevy-plugins.sh features sdk/raea/bench/bevy-plugins)
t() { s=$SECONDS; "$@"; echo "::notice::Windows $(( (SECONDS - s) / 60 )) min: ${*:7}"; }
t cargo build --profile dist --locked -p raea-cli --bin raea --no-default-features --features "$feat"
t cargo build --profile dist --locked -p raea-rune-host
t cargo build --profile dist --locked -p raea-page-host --features window
t cargo build --profile dist --locked -p raea-perceive
if [ -n "${RUSTC_WRAPPER:-}" ]; then sccache --show-stats; fi
- name: The candidate's binaries (tools/release/promoted-bins.sh)
if: env.RAEA_PROMOTED_FROM != ''
env:
GH_TOKEN: ${{ github.token }}
run: bash tools/release/promoted-bins.sh "$RAEA_PROMOTED_FROM" target/dist
# ONNX Runtime as Microsoft builds it (MIT), beside raea.exe, which loads it when a model first runs (#110): the
# static runtime ort links by default is built for AVX2 and stopped raea.exe at start on CPUs without it
- name: ONNX Runtime (tools/release/onnxruntime.sh)
run: bash tools/release/onnxruntime.sh target/dist
# and what a PC with nothing installed and no downloads needs beside raea.exe: the VC++ runtime (from this
# runner's Visual Studio), FFmpeg (raea's LGPL build) and uv, each with its licence
- name: The Windows bundle (tools/release/win-bundle.sh)
run: bash tools/release/win-bundle.sh target/dist
# which DLLs raea needs from the machine (the CRT's now ship beside it: win-bundle.sh)
- name: What raea.exe imports
run: |
{ echo '### what raea.exe, raea_bundle.dll, raea-perceive.exe and onnxruntime.dll import'; echo '```'
dumpbin=$(ls "/c/Program Files/Microsoft Visual Studio"/*/*/VC/Tools/MSVC/*/bin/HostX64/x64/dumpbin.exe | head -1)
"$dumpbin" -nologo -dependents target/dist/raea.exe target/dist/raea_bundle.dll target/dist/raea-perceive.exe target/dist/onnxruntime.dll target/dist/ffmpeg.exe | grep -iE '\.dll$|Dump of' | sed 's/^ *//'
echo '```'; } | tee -a "$GITHUB_STEP_SUMMARY" || true
# release.sh's checks render on Mesa's lavapipe (software Vulkan, MIT; on the runner only, never in the zip): the
# runner has no GPU, and WARP, Windows' own software DX12, crashes compiling one of Bevy's compute shaders there
# (d3d10warp ComputeShaderTransformer::ConstructLoadStoreSets, an access violation; 11-04)
- name: Software Vulkan
run: bash tools/release/lavapipe.sh
- name: Where the skills gate passed
run: bash tools/release/skills-passed.sh "$TAG" "${{ inputs.skills_passed }}"
- name: Pack and check (tools/release.sh)
env:
RAEA_CHECK_DIR: ${{ runner.temp }}/release-check
run: bash tools/release.sh "${TAG#v}" target/dist HEAD
# live play on Windows (PT20 left it unproven): bevy-ts's play cases, `play --offscreen` with an input script and
# a snapshot's pixels probed, run by the raea just built; check.sh reads the pixels with ImageMagick, which the
# image has only sometimes, and choco's PATH change doesn't reach the next step, so its folder goes on GITHUB_PATH
- name: ImageMagick (check.sh reads a snapshot's pixels)
shell: pwsh
run: |
if (-not (Get-Command magick -ErrorAction SilentlyContinue)) { choco install imagemagick -y --no-progress | Out-Null }
$im = Get-ChildItem "C:\Program Files" -Directory -Filter "ImageMagick-*" | Select-Object -First 1
if ($im) { Add-Content $env:GITHUB_PATH $im.FullName }
# without the loader's debug lines (lavapipe.sh sets them for the driver's registration), and a failing case's
# log tail in the job's log, since the runner and its logs go when the job ends
# each case is bounded by check.sh (RAEA_CASE_SECONDS: a fresh runner's first play opens in about 100s, the next in
# seconds); the step's own bound is for the rest
- name: Live play (bevy-ts's play cases)
timeout-minutes: 75
env:
VK_LOADER_DEBUG: ""
RAEA_CASE_SECONDS: "300"
# the zip's raea, unpacked, with RAEA_NO_TREE=1 and the cases copied out of the checkout, as a user's machine has
# them: target/dist's raea has no share/raea beside it, so its home is this checkout, 2 h of build in target/
# included, and there its 3D cases ran past 300 s each (rc1) where the unpacked zip's open in under 70 s
run: |
u="$RUNNER_TEMP/play-zip"; c="$RUNNER_TEMP/play-cases"
mkdir -p "$u" && 7z x -y -o"$u" dist/raea-*.zip > /dev/null && cp -r sdk/raea/bench/bevy-ts/cases "$c"
b="$u/raea/bin/raea.exe"
out="${TMPDIR:-/tmp}/raea-bevy-ts"
s=0; RAEA_NO_TREE=1 RAEA_BIN="$b" RAEA_PLUGIN_BIN="$b" bash sdk/raea/bench/bevy-ts/check.sh $(grep -l '^// play:' "$c"/*.tsx) 2>&1 | tee "$RUNNER_TEMP/play.txt" || s=$?
cat "$RUNNER_TEMP/play.txt" >> "$GITHUB_STEP_SUMMARY"
for n in $(sed -n 's/^\([^ ]*\) (.*): OPEN.*/\1/p' "$RUNNER_TEMP/play.txt"); do echo "--- $n"; { grep -v "known driver" "$out/$n.log" || echo "(its log is empty)"; } | tail -25; done
exit $s
- uses: actions/attest-build-provenance@v2
if: ${{ !inputs.dry_run }}
with:
subject-path: dist/raea-*.zip
# kept even when its check fails, with the check's own files, so a failure can be looked into on a fresh runner
# without a rebuild; only windows-verify attaches it to the release
- uses: actions/upload-artifact@v4
if: always()
with:
name: windows-zip
path: dist/raea-*.zip*
retention-days: 7
compression-level: 0
if-no-files-found: ignore
- uses: actions/upload-artifact@v4
if: failure()
with:
name: release-check-Windows
path: ${{ runner.temp }}/release-check/app
retention-days: 7
if-no-files-found: ignore
# the zip alone, on a runner that never had raea's sources, as a user's machine gets it; it also tests the
# published installer (raea.io/install.ps1), pointed at the zip by RAEA_DOWNLOAD. Only a zip that passes is attached.
windows-verify:
needs: windows
runs-on: windows-latest
timeout-minutes: 20
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.TAG }}
lfs: false
sparse-checkout: |
tools/release-check.sh
tools/release/win-bundle.files
tools/release/lavapipe.sh
sparse-checkout-cone-mode: false
path: check
- uses: actions/download-artifact@v4
with:
name: windows-zip
path: ${{ runner.temp }}/zip
- name: Software Vulkan
run: bash check/tools/release/lavapipe.sh
- name: The zip, unpacked and checked
run: |
set -e
v=${TAG#v}
# and the list of what bin\ must carry, where release-check.sh looks for it (release/ beside it)
cp check/tools/release-check.sh "$RUNNER_TEMP/" && mkdir -p "$RUNNER_TEMP/release" && cp check/tools/release/win-bundle.files "$RUNNER_TEMP/release/"
rm -rf check
cd "$RUNNER_TEMP/zip"
sha256sum -c "raea-$v-windows-x86_64.zip.sha256"
bash "$RUNNER_TEMP/release-check.sh" "$PWD/raea-$v-windows-x86_64.zip" | tee -a "$GITHUB_STEP_SUMMARY"
- name: install.ps1, then a render from PATH
shell: pwsh
run: |
$v = $env:TAG.Substring(1)
$rel = Join-Path $env:RUNNER_TEMP "rel"
New-Item -ItemType Directory -Force -Path (Join-Path $rel "v$v") | Out-Null
Copy-Item (Join-Path $env:RUNNER_TEMP "zip/raea-$v-windows-x86_64.zip*") (Join-Path $rel "v$v")
$env:RAEA_DOWNLOAD = $rel; $env:RAEA_VERSION = $v; $env:RAEA_NO_SKILLS = "1"
& ([scriptblock]::Create((Invoke-RestMethod https://raea.io/install.ps1)))
$p = Join-Path $env:RUNNER_TEMP "user"; New-Item -ItemType Directory -Force -Path $p | Out-Null; Set-Location $p
$env:RAEA_NO_TREE = "1"; $env:RAEA_API = "http://127.0.0.1:9"
raea init
if ($LASTEXITCODE) { throw "raea init failed" }
Set-Content hello.tsx 'import { AbsoluteFill, Composition, registerRoot } from "raea"; registerRoot(() => <Composition id="hello" component={() => <AbsoluteFill style={{ background: "#123", color: "#fff", fontSize: 90, justifyContent: "center", alignItems: "center" }}>raea on Windows</AbsoluteFill>} width={640} height={360} fps={30} durationInFrames={30} />);'
$h = Join-Path $env:RUNNER_TEMP "hello"; New-Item -ItemType Directory -Force -Path $h | Out-Null; Move-Item hello.tsx $h; Set-Location $h
raea render hello.tsx --frame 1 -o hello.png
if ($LASTEXITCODE -or -not (Test-Path hello.png)) { throw "raea render failed" }
Get-Item hello.png | Format-List Name, Length
- name: Attach to the release
if: ${{ !inputs.dry_run }}
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release view "$TAG" -R "$GITHUB_REPOSITORY" >/dev/null 2>&1 || gh release create "$TAG" -R "$GITHUB_REPOSITORY" ${{ contains(env.TAG, '-') && '--prerelease' || '' }} --title "raea ${TAG#v}" --notes "Built by .github/workflows/release.yml; notes follow."
gh release upload "$TAG" -R "$GITHUB_REPOSITORY" "$RUNNER_TEMP"/zip/raea-*.zip "$RUNNER_TEMP"/zip/raea-*.zip.sha256 --clobber