Skip to content

ad-engine: stream the captured System State to PBS #117

ad-engine: stream the captured System State to PBS

ad-engine: stream the captured System State to PBS #117

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
# Cancel an in-progress run when a newer commit lands on the same branch/PR, so
# rapid pushes do not pile up slow Windows installer builds.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
lint-and-test:
name: Lint, test, build (Linux)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
# WebKitGTK is Tauri's Linux webview; this lets the fast Linux job compile
# the GUI too, so build breaks surface here instead of only on Windows.
- name: Install Tauri Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev librsvg2-dev
- name: rustfmt
run: cargo fmt --all -- --check
- name: clippy (whole workspace, including the Tauri app)
run: cargo clippy --workspace --all-targets -- -D warnings
- name: test
run: cargo test --workspace
build-windows:
name: Build app + installer (Windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install NASM (needed to build ring)
uses: ilammy/setup-nasm@v1
- name: Install Tauri CLI
run: npm install -g @tauri-apps/cli@^2
- name: Compute build id
shell: pwsh
run: |
$short = "${{ github.sha }}".Substring(0, 7)
$ver = "0.0.${{ github.run_number }}"
"PBSGUI_SHORT=$short" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
"PBSGUI_VERSION=$ver" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
"PBSGUI_BUILD=$ver ($short)" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
'{"version":"' + $ver + '"}' | Out-File -FilePath build-version.json -Encoding ascii
- name: Build engine
run: cargo build -p pbsgui-engine --release
- name: Stage engine as a Tauri sidecar
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path src-tauri/binaries | Out-Null
Copy-Item target/release/pbsgui-engine.exe `
src-tauri/binaries/pbsgui-engine-x86_64-pc-windows-msvc.exe
- name: Build app and NSIS installers (offline + online)
# The windows config adds the engine as a bundled sidecar; the base config
# stays free of it so `tauri dev` does not require the staged binary. We
# build the full offline installer (bundles WebView2) and a smaller online
# one (webview-online.conf.json -> downloads WebView2 at install).
shell: pwsh
run: |
$nsis = 'target/release/bundle/nsis'
New-Item -ItemType Directory -Force -Path dist | Out-Null
tauri build --config src-tauri/engine-sidecar.conf.json --config build-version.json
$full = Get-ChildItem "$nsis/*-setup.exe" | Select-Object -First 1
Copy-Item $full.FullName "dist/$($full.Name)"
tauri build --config src-tauri/engine-sidecar.conf.json --config build-version.json --config src-tauri/webview-online.conf.json
$small = Get-ChildItem "$nsis/*-setup.exe" | Select-Object -First 1
Copy-Item $small.FullName ("dist/{0}-online{1}" -f $small.BaseName, $small.Extension)
# Signing is wired but gated on the DigiCert secrets (see release.yml); CI
# builds are unsigned. Upload the two installers as SEPARATE artifacts so the
# small online one (~5 MB) can be downloaded without the ~200 MB offline one.
- name: Upload online installer (small)
uses: actions/upload-artifact@v4
with:
name: pbsgui-installer-online-${{ env.PBSGUI_VERSION }}-${{ env.PBSGUI_SHORT }}
path: dist/*-setup-online.exe
if-no-files-found: error
- name: Upload offline installer (full)
uses: actions/upload-artifact@v4
with:
name: pbsgui-installer-offline-${{ env.PBSGUI_VERSION }}-${{ env.PBSGUI_SHORT }}
path: dist/*_x64-setup.exe
if-no-files-found: error