Files
waggle-os/.github/workflows/release.yml
shumeiko.it 687e3b86c7 ci(release): replace the commercial pipeline with an unsigned build for three systems (P1.3d)
release.yml now has one build job with a matrix over the four release
targets (windows-x64, macos-arm64, macos-x64, linux-x64). Each leg stages
the sidecar, checks it, builds the web UI, packs the server archive for
the installer (ADR-0009), runs the installer smoke test, builds the
desktop installers (NSIS and MSI, app and DMG, deb and AppImage), runs
the packaged app until its sidecar answers /health, and uploads the
installers and archives. A pushed v* tag also gets a draft GitHub
release with a SHA256SUMS file, created with GITHUB_TOKEN only. Pull
requests on the desktop paths and manual runs build and test without
publishing, so tauri-build-pr.yml is removed.

Nothing is signed or notarized. The macOS app gets an ad-hoc signature
("-"), which needs no certificate; without it macOS reports a downloaded
Apple Silicon app as damaged.

Removed with the old pipeline, as nothing else used them: the Windows
signing handoff and signer (sign-windows-artifact.ps1 and its tests,
new-windows-signing-handoff.ps1), the pilot signing scripts
(sign-windows-pilot.ps1, apply-signing-config.mjs, signing-config.ts and
its test, sign-macos-adhoc.sh, tauri.build-override.conf.json and the
tauri:sign:* and tauri:build:win:pilot-signed scripts), the installer
certifier with its bootstrap-token helper, and the Windows release
publisher. check-sidecar-resources.mjs stays: tauri.conf.json runs it
before every desktop build and the workflow runs it before packing the
archive.

app/package.json gains tauri:build:linux. The tests that pinned the old
workflows, the certifier, the signer and the publisher are removed;
new tests pin the targets, the step order, the absence of signing and of
secrets other than GITHUB_TOKEN, and the draft-only, tag-only publish.
2026-11-01 02:08:31 +01:00

254 lines
9.6 KiB
YAML

# Release build for the community edition (P1.3d).
#
# On each release target the build job stages the sidecar payload, packs the
# server archive for the installer (ADR-0009), builds the desktop installers,
# smoke-tests the installer and the desktop app, and uploads everything as a
# workflow artifact. A pushed v* tag also gets a draft GitHub release with a
# SHA256SUMS file. Pull requests and manual runs build and test only.
#
# Nothing is signed or notarized, and the only secret is GITHUB_TOKEN. The
# macOS app gets an ad-hoc signature ("-"), which needs no certificate: without
# one, macOS reports a downloaded Apple Silicon app as damaged.
name: Release
on:
push:
tags:
- 'v*'
pull_request:
branches:
- main
paths:
- 'app/**'
- 'apps/web/**'
- 'packages/**'
- 'scripts/**'
- 'package.json'
- 'package-lock.json'
- '.github/workflows/release.yml'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
# The embedding model runs on CPU; skip the CUDA download on Linux (ADR-0008).
ONNXRUNTIME_NODE_INSTALL_CUDA: skip
jobs:
build:
name: Build (${{ matrix.release_target }})
strategy:
fail-fast: false
matrix:
include:
- runner: windows-latest
rust_target: x86_64-pc-windows-msvc
release_target: windows-x64
arch: x64
bundles: nsis,msi
- runner: macos-15
rust_target: aarch64-apple-darwin
release_target: macos-arm64
arch: arm64
bundles: app,dmg
- runner: macos-15-intel
rust_target: x86_64-apple-darwin
release_target: macos-x64
arch: x64
bundles: app,dmg
- runner: ubuntu-22.04
rust_target: x86_64-unknown-linux-gnu
release_target: linux-x64
arch: x64
bundles: deb,appimage
runs-on: ${{ matrix.runner }}
timeout-minutes: 120
env:
# The staging scripts take the Node runtime and native modules for this architecture.
TARGET_ARCH: ${{ matrix.arch }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
# The Node version the installer and the desktop app ship (ADR-0008).
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22.23.2
cache: npm
cache-dependency-path: |
package-lock.json
app/package-lock.json
- name: Verify runner architecture
run: node -e "if (process.arch !== process.env.TARGET_ARCH) { console.error('Expected ' + process.env.TARGET_ARCH + ' runner, got ' + process.arch); process.exit(1); }"
- name: Setup Rust
uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4
with:
toolchain: 1.94.0
targets: ${{ matrix.rust_target }}
- name: Rust cache
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
workspaces: app/src-tauri
key: ${{ matrix.rust_target }}
# Tauri 2 build dependencies, plus Xvfb and D-Bus for the desktop smoke test.
- name: Install Linux system packages
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev \
libxdo-dev libssl-dev patchelf file xdg-utils xvfb dbus
- name: Install dependencies
run: npm ci
- name: Install locked Tauri CLI
run: npm ci --prefix app --ignore-scripts
# The staged sidecar carries the dist/ builds of the workspace packages.
- name: Build packages
run: npm run build:packages
- name: Build installer
run: npm run build --workspace @waggle-ai/waggle
# On Windows these steps run in PowerShell, the default shell, where tar
# is the system bsdtar that bundle-node and build-server-archive expect.
- name: Bundle Node.js runtime
run: node scripts/bundle-node.mjs
- name: Build sidecar
run: node scripts/build-sidecar.mjs
- name: Bundle native dependencies
run: node scripts/bundle-native-deps.mjs
- name: Stage sidecar dependencies
run: node scripts/stage-sidecar-deps.mjs
- name: Check sidecar resources
run: node scripts/check-sidecar-resources.mjs
- name: Build web UI
run: cd apps/web && npx vite build
- name: Build server archive
run: node scripts/build-server-archive.mjs
# Install, doctor, run on a free port with a temporary data directory,
# wait for /health, stop, uninstall.
- name: Installer smoke test
timeout-minutes: 15
run: node scripts/release-smoke.mjs installer
- name: Build desktop app
if: runner.os != 'macOS'
run: cd app && node node_modules/@tauri-apps/cli/tauri.js build --target ${{ matrix.rust_target }} --bundles "${{ matrix.bundles }}"
- name: Build desktop app (macOS, ad-hoc signature)
if: runner.os == 'macOS'
run: cd app && node node_modules/@tauri-apps/cli/tauri.js build --target ${{ matrix.rust_target }} --bundles "${{ matrix.bundles }}" --config '{"bundle":{"macOS":{"signingIdentity":"-"}}}'
# Each desktop smoke test starts the packaged app, waits until its sidecar
# answers /health on 127.0.0.1:3333, then stops the app and the sidecar.
- name: Desktop smoke test (Windows)
if: runner.os == 'Windows'
timeout-minutes: 15
run: |
$setup = Get-ChildItem app/src-tauri/target/${{ matrix.rust_target }}/release/bundle/nsis/*-setup.exe | Select-Object -First 1
$installDir = Join-Path $env:RUNNER_TEMP 'waggle-desktop'
# A silent per-user install into a temporary directory.
$installer = Start-Process -FilePath $setup.FullName -ArgumentList '/S', "/D=$installDir" -Wait -PassThru
if ($installer.ExitCode -ne 0) { throw "The NSIS installer exited with code $($installer.ExitCode)" }
$app = Get-ChildItem -LiteralPath $installDir -Filter *.exe | Where-Object { $_.Name -notlike 'uninstall*' } | Select-Object -First 1
if (-not $app) { throw "No app executable in $installDir" }
node scripts/release-smoke.mjs desktop --app $app.FullName
- name: Desktop smoke test (macOS)
if: runner.os == 'macOS'
timeout-minutes: 15
run: node scripts/release-smoke.mjs desktop --app app/src-tauri/target/${{ matrix.rust_target }}/release/bundle/macos/Waggle.app
- name: Desktop smoke test (Linux)
if: runner.os == 'Linux'
timeout-minutes: 15
env:
# WebKitGTK has no GPU compositing under Xvfb.
WEBKIT_DISABLE_COMPOSITING_MODE: '1'
run: |
deb=$(ls app/src-tauri/target/${{ matrix.rust_target }}/release/bundle/deb/*.deb)
sudo apt-get install -y "$PWD/$deb"
app=$(dpkg-deb --contents "$deb" | awk '$1 ~ /^-/ && $6 ~ /^\.\/usr\/bin\// { print substr($6, 2); exit }')
xvfb-run --auto-servernum dbus-run-session -- node scripts/release-smoke.mjs desktop --app "$app"
- name: Collect installers
shell: bash
run: |
bundle=app/src-tauri/target/${{ matrix.rust_target }}/release/bundle
case "$RUNNER_OS" in
Windows) cp "$bundle"/nsis/*-setup.exe "$bundle"/msi/*.msi artifacts/ ;;
macOS) cp "$bundle"/dmg/*.dmg artifacts/ ;;
Linux) cp "$bundle"/deb/*.deb "$bundle"/appimage/*.AppImage artifacts/ ;;
esac
ls -l artifacts
- name: Upload build outputs
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: waggle-${{ matrix.release_target }}
path: artifacts/
if-no-files-found: error
retention-days: 14
publish:
name: Draft GitHub release
needs: build
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-22.04
timeout-minutes: 30
permissions:
contents: write
steps:
- name: Download build outputs
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
pattern: waggle-*
path: release
merge-multiple: true
# The installer downloads release v<launcher version>, and the desktop
# installers carry the app version. Warn when the tag differs from either.
- name: Check versions
env:
TAG: ${{ github.ref_name }}
run: |
version="${TAG#v}"
compgen -G "release/waggle-server-$version-*.tar.gz" > /dev/null \
|| echo "::warning::No server archive for $TAG: packages/launcher/package.json has another version."
compgen -G "release/Waggle_${version}_*" > /dev/null \
|| echo "::warning::No desktop installer for $TAG: app/src-tauri/tauri.conf.json has another version."
- name: Write SHA256SUMS
working-directory: release
run: |
find . -maxdepth 1 -type f ! -name '*.sha256' -printf '%f\n' | LC_ALL=C sort | xargs -d '\n' sha256sum > SHA256SUMS
cat SHA256SUMS
- name: Create draft release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
TAG: ${{ github.ref_name }}
run: gh release create "$TAG" release/* --draft --verify-tag --title "Waggle $TAG" --generate-notes