mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-01 12:44:11 -10:00
507 lines
29 KiB
YAML
507 lines
29 KiB
YAML
# 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.
|
|
# Linux also packages and checks an AppImage from the same verified archive (tools/release-appimage.sh).
|
|
# 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/[email protected]
|
|
# 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
|
|
- name: Package and check the Linux AppImage
|
|
if: runner.os == 'Linux'
|
|
env:
|
|
RAEA_CHECK_DIR: ${{ runner.temp }}/appimage-check
|
|
run: xvfb-run -a -s "-screen 0 1280x1024x24" bash tools/release-appimage.sh "${TAG#v}" "dist/raea-${TAG#v}-linux-x86_64.tar.gz"
|
|
# 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
|
|
${{ runner.temp }}/appimage-check/app
|
|
${{ runner.temp }}/appimage-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
|
|
- uses: actions/attest-build-provenance@v2
|
|
if: ${{ runner.os == 'Linux' && !inputs.dry_run }}
|
|
with:
|
|
subject-path: dist/raea-*.AppImage
|
|
- 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
|
|
if [ "$RUNNER_OS" = Linux ]; then
|
|
gh release upload "$TAG" dist/raea-*.AppImage dist/raea-*.AppImage.sha256 --clobber
|
|
fi
|
|
- uses: actions/upload-artifact@v4
|
|
if: ${{ inputs.dry_run }}
|
|
with:
|
|
name: dry-run-${{ runner.os }}
|
|
path: |
|
|
dist/raea-*.tar.gz*
|
|
dist/raea-*.AppImage*
|
|
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' }}
|
|
# the signing identity's federated credential trusts this repository's environment "signing" and nothing else
|
|
# (Azure app raea-release-signing); with no identity set there is no environment, and the zip is unsigned
|
|
environment: ${{ vars.AZURE_SIGN_CLIENT_ID != '' && 'signing' || '' }}
|
|
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/[email protected]
|
|
# 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 }}"
|
|
# raea's own Windows programs signed (#221), once the repository has the signing identity: the variables
|
|
# AZURE_SIGN_CLIENT_ID, AZURE_SIGN_TENANT_ID and AZURE_SIGN_SUBSCRIPTION_ID name an Azure app whose federated
|
|
# credential trusts this workflow and which holds the Artifact Signing Certificate Profile Signer role on the
|
|
# account (no secret is stored: the job's own token is exchanged). Without them the zip is unsigned, as before
|
|
- name: Sign in to Azure for signing
|
|
if: ${{ vars.AZURE_SIGN_CLIENT_ID != '' }}
|
|
uses: azure/login@v2
|
|
with:
|
|
client-id: ${{ vars.AZURE_SIGN_CLIENT_ID }}
|
|
tenant-id: ${{ vars.AZURE_SIGN_TENANT_ID }}
|
|
subscription-id: ${{ vars.AZURE_SIGN_SUBSCRIPTION_ID }}
|
|
- name: jsign (signs raea's programs)
|
|
if: ${{ vars.AZURE_SIGN_CLIENT_ID != '' }}
|
|
run: choco install jsign -y --no-progress
|
|
- name: Pack and check (tools/release.sh)
|
|
env:
|
|
RAEA_CHECK_DIR: ${{ runner.temp }}/release-check
|
|
RAEA_WIN_SIGN: ${{ vars.AZURE_SIGN_CLIENT_ID != '' && '1' || '' }}
|
|
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
|