Repository navigation
315 lines (274 loc) · 12.3 KB
/
Copy pathbuild.yml
File metadata and controls
315 lines (274 loc) · 12.3 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
name: Build + Package
permissions:
contents: read
actions: read
checks: read
on:
# Master pushes are already covered by ci.yml (Rust on three OSes, WASM, JS)
# and the Native desktop E2E lane. This packaging matrix duplicates them and
# is normally cancelled by the next push, so it runs only for pull requests
# and explicit dispatch.
pull_request:
branches: [master]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-wasm:
name: Build WASM engine (base + SIMD)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8
with:
toolchain: 1.97.1
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0
- name: Install just
uses: taiki-e/install-action@3a3daafd3b7f23b8f65d9f5ba2db203fb59b79e2
with:
tool: just@1.54.0
- name: Install wasm-pack (pinned, verified)
uses: taiki-e/install-action@3a3daafd3b7f23b8f65d9f5ba2db203fb59b79e2
with:
tool: wasm-pack@0.13.1
checksum: true
fallback: none
- name: wasm build (base + simd)
run: just wasm-build-all
- name: Upload wasm artifact
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: varve-wasm-release
path: apps/desktop/public/wasm/
# Which runners this event is allowed to use.
#
# The repository is public (2026-08-04), so GitHub-hosted runners are free and
# unmetered — this is no longer about the bill. It is kept because a full
# three-OS Tauri build on every PR costs 30-60 minutes of wall-clock feedback
# for signal that a Linux build already gives, and because macOS and Windows
# runners are a shared, queue-limited resource.
#
# Pull requests get the Linux gate only. The other runners are reserved for
# pushes to the default branch and manual dispatch. Feature-branch pushes are
# covered by the PR run, avoiding a duplicate three-OS build. Release artifacts
# come from release.yml, not here.
plan:
name: Plan runners
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
matrix: ${{ steps.pick.outputs.matrix }}
steps:
- id: pick
run: |
# Linux build cells stay on 24.04. ubuntu-latest is 26.04 (resolute)
# and has no install candidate for libgdk-pixbuf2.0-dev, which the
# build job still apt-installs for the WebKitGTK 4.1 setup.
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo 'matrix={"os":["ubuntu-24.04"]}' >> "$GITHUB_OUTPUT"
else
echo 'matrix={"os":["ubuntu-24.04","macos-latest","windows-latest"]}' >> "$GITHUB_OUTPUT"
fi
build:
name: Build (${{ matrix.os }})
needs: [build-wasm, plan]
timeout-minutes: 90
strategy:
fail-fast: false
# Limit simultaneous runner acquisitions: firing all three OS cells at
# once is what starves the hosted runner pool during Actions incidents.
max-parallel: 2
matrix: ${{ fromJSON(needs.plan.outputs.matrix) }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115
with:
version: 11.9.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
with:
node-version: '26.10.0'
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8
with:
toolchain: 1.97.1
components: rustfmt, clippy
- name: Install Linux system deps
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libwebkit2gtk-4.1-dev libgtk-3-dev librsvg2-dev libssl-dev \
libfontconfig1-dev libglib2.0-dev libsoup-3.0-dev \
libgdk-pixbuf2.0-dev libcairo2-dev libpango1.0-dev \
cmake pkg-config patchelf
- name: Install macOS Rust targets
if: runner.os == 'macOS'
run: |
rustup target add x86_64-apple-darwin aarch64-apple-darwin
- name: Install Windows Rust target
if: runner.os == 'Windows'
run: rustup target add x86_64-pc-windows-msvc
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0
- name: Install JS dependencies
run: pnpm install --frozen-lockfile
# Real Windows command dispatch and macOS path aliases need their own
# native tooling check before spending time on Rust builds. Keep this on
# each selected OS; the canonical CI workflow owns shared JS validation.
- name: CI tooling portability preflight
run: pnpm test:ci:tools
- name: Lint (Rust)
run: node scripts/cargo-with-generative-bindgen.mjs clippy --workspace --all-targets -- -D warnings
- name: Rust tests
run: node scripts/cargo-with-generative-bindgen.mjs test --workspace --all-targets
- name: Download wasm artifact
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333
with:
name: varve-wasm-release
path: apps/desktop/public/wasm/
- name: Build frontend
run: pnpm build
working-directory: apps/desktop
# Must run after "Build frontend". Anything that compiles the desktop
# crate expands `tauri::generate_context!()`, which reads tauri.conf.json
# and hard-fails if `frontendDist` ("../dist") is absent:
#
# error: proc macro panicked
# = help: message: The `frontendDist` configuration is set to
# `"../dist"` but this path doesn't exist
#
# This step used to sit above the frontend build and failed on all three
# runners for that reason. It went unnoticed because earlier steps in the
# job errored first, so the ordering was never actually exercised.
- name: Rust tests (desktop)
run: node scripts/cargo-with-generative-bindgen.mjs test --manifest-path apps/desktop/src-tauri/Cargo.toml --features custom-protocol
# Compile-and-link check, not a packaging run. `--no-bundle` skips the
# installer generation (AppImage tooling download, WiX, DMG staging),
# which is the slow half of this matrix job. Release installers are built
# by release.yml from a tag. The separate `linux-appimage-offline-smoke`
# job below is the one non-publishing AppImage pack on pull requests.
- name: Tauri build (release, no bundle)
run: pnpm tauri build --ci --no-bundle --features custom-protocol
working-directory: apps/desktop
- name: Build test binary (debug + wdio features)
if: runner.os == 'Linux'
working-directory: apps/desktop
run: pnpm tauri build --debug --no-bundle --config src-tauri/tauri.test.conf.json --features wdio,custom-protocol
# Failure diagnostics are produced once per failed run by the ci-debug.yml
# workflow_run, which sees every job's finalized logs; a per-job copy was
# a partial duplicate of that report.
# This matrix job does not upload installers. The AppImage offline-smoke
# job below is the only packaging upload, and it is evidence only.
# Non-publishing AppImage proof for PRs. Builds on ubuntu-22.04 (glibc 2.35
# floor), prunes host GPU/system libs, then launches the file in ubuntu:22.04
# and fedora:latest containers with no host WebKitGTK and --network none.
# Does not create a tag, draft release, checksum asset, or GitHub Release.
linux-appimage-offline-smoke:
name: Linux AppImage (offline smoke)
runs-on: ubuntu-22.04
timeout-minutes: 90
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115
with:
version: 11.9.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
with:
node-version: '26.10.0'
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8
with:
toolchain: 1.97.1
components: rustfmt
- name: Install Linux system deps
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libwebkit2gtk-4.1-dev libgtk-3-dev librsvg2-dev libssl-dev \
libfontconfig1-dev libglib2.0-dev libsoup-3.0-dev \
libgdk-pixbuf2.0-dev libcairo2-dev libpango1.0-dev \
cmake pkg-config patchelf file \
squashfs-tools xdg-utils
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0
with:
key: linux-appimage-offline-smoke
workspaces: |
. -> target
apps/desktop/src-tauri -> target
cache-on-failure: true
- name: Install JS dependencies
run: pnpm install --frozen-lockfile
- name: Pin linuxdeploy-plugin-gtk
run: node scripts/release/ensure-linuxdeploy-plugin-gtk.mjs --tools-dir "$HOME/.cache/tauri"
- name: Fetch ONNX Runtime for linux-x86_64
run: node scripts/fetch-onnxruntime.mjs
- name: Prune foreign ONNX runtimes
run: node scripts/release/prune-foreign-runtimes.mjs
- name: Build frontend
run: pnpm build
working-directory: apps/desktop
- name: Tauri AppImage (no updater artifacts)
env:
NO_STRIP: '1'
run: >
pnpm tauri build --bundles appimage --ci --features ai
--config '{"bundle":{"createUpdaterArtifacts":false}}'
working-directory: apps/desktop
- name: Prune bundled host GPU and system libraries
run: |
mkdir -p appimage-evidence
node scripts/release/prune-appimage-bundled-libs.mjs \
--bundle-dir apps/desktop/src-tauri/target/release/bundle \
--arch x86_64 \
--tools-dir "$HOME/.cache/tauri" | tee appimage-evidence/prune.log
- name: Verify AppImage squashfs permissions
run: |
node scripts/release/verify-appimage-permissions.mjs \
--bundle-dir apps/desktop/src-tauri/target/release/bundle
- name: Record size, SHA-256, and bundled library listing
run: |
set -euo pipefail
IMG="$(find apps/desktop/src-tauri/target/release/bundle/appimage -maxdepth 1 -name '*.AppImage' -print -quit)"
if [[ -z "${IMG}" ]]; then
echo "::error::No AppImage was produced."
exit 1
fi
IMG="$(realpath "${IMG}")"
chmod +x "${IMG}"
mkdir -p appimage-evidence
echo "${IMG}" > appimage-evidence/path.txt
stat -c '%s %n' "${IMG}" | tee appimage-evidence/size.txt
sha256sum "${IMG}" | tee appimage-evidence/sha256.txt
EXTRACT="$(mktemp -d "${RUNNER_TEMP:-/tmp}/varve-appimage-listing.XXXXXX")"
(
cd "${EXTRACT}"
"${IMG}" --appimage-extract >/dev/null
find squashfs-root/usr/lib -printf '%P\n' | sort > "${GITHUB_WORKSPACE}/appimage-evidence/usr-lib.txt"
)
echo "AppImage $(basename "${IMG}")"
cat appimage-evidence/size.txt
cat appimage-evidence/sha256.txt
- name: Offline smoke (ubuntu:22.04 and fedora:latest)
run: |
set -euo pipefail
IMG="$(find apps/desktop/src-tauri/target/release/bundle/appimage -maxdepth 1 -name '*.AppImage' -print -quit)"
IMG="$(realpath "${IMG}")"
mkdir -p appimage-evidence/smoke
bash scripts/release/smoke-appimage-self-contained.sh \
--appimage "${IMG}" \
--distro all \
--log-dir "${GITHUB_WORKSPACE}/appimage-evidence/smoke"
- name: Upload AppImage offline-smoke artifacts
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: linux-appimage-offline-smoke-${{ github.run_id }}
path: |
apps/desktop/src-tauri/target/release/bundle/appimage/*.AppImage
appimage-evidence/**
if-no-files-found: warn
retention-days: 14