88 type : boolean
99 default : false
1010 promote_version :
11- description : Promote a validated version (e.g. 0.0.0-preview.22.1) to the macOS preview updater feed; no build
11+ description : Promote a validated version (e.g. 0.0.0-preview.22.1) to the preview updater feed; no build
1212 type : string
1313 default : " "
1414 schedule :
1717permissions :
1818 contents : read
1919
20+ env :
21+ # Public verification inputs; the native build and plugins.updater must match.
22+ # Candidate-only runs build without the updater.
23+ BUZZ_UPDATER_PUBLIC_KEY : ${{ !inputs.candidates && 'dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDJDQjQ2RDZFMUEwOERFMTEKUldRUjNnZ2FibTIwTE10QkVaMzFyYkZlY0R4ajhmbFBjdncvNVRCYnNpSm9kaFNBaHQzemZlZHkK' || '' }}
24+ BUZZ_UPDATER_ENDPOINT : ${{ !inputs.candidates && 'https://github.com/block/buzz-app/releases/download/preview-feed/latest.json' || '' }}
25+
2026concurrency :
2127 group : desktop-preview-${{ inputs.candidates && github.ref || 'macos-prerelease' }}
2228 cancel-in-progress : false
3541 env :
3642 CI : " true"
3743 CARGO_TERM_COLOR : always
38- # Public verification inputs; the native build and plugins.updater must match.
39- BUZZ_UPDATER_PUBLIC_KEY : dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDJDQjQ2RDZFMUEwOERFMTEKUldRUjNnZ2FibTIwTE10QkVaMzFyYkZlY0R4ajhmbFBjdncvNVRCYnNpSm9kaFNBaHQzemZlZHkK
40- BUZZ_UPDATER_ENDPOINT : https://github.com/block/buzz-app/releases/download/preview-feed/latest.json
4144 steps :
4245 - name : Require main and signing configuration
4346 env :
@@ -153,7 +156,7 @@ jobs:
153156
154157 publish :
155158 name : Publish GitHub prerelease
156- needs : [build, windows, linux]
159+ needs : [build, windows, linux, updater_signatures ]
157160 runs-on : ubuntu-latest
158161 timeout-minutes : 5
159162 permissions :
@@ -171,6 +174,10 @@ jobs:
171174 with :
172175 name : linux-x64-candidates
173176 path : build-assets/linux
177+ - uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
178+ with :
179+ name : windows-linux-updater-signatures
180+ path : build-assets/signatures
174181 - name : Verify and assemble release assets
175182 env :
176183 VERSION : ${{ needs.build.outputs.version }}
@@ -189,6 +196,9 @@ jobs:
189196 cp "build-assets/windows/Buzz_${VERSION}_x64_unsigned.exe" release-assets/
190197 cp "build-assets/linux/Buzz_${VERSION}_amd64.deb" release-assets/
191198 cp "build-assets/linux/Buzz_${VERSION}_x86_64.AppImage" release-assets/
199+ for installer in x64_unsigned.exe amd64.deb x86_64.AppImage; do
200+ cp "build-assets/signatures/Buzz_${VERSION}_${installer}.sig" release-assets/
201+ done
192202 printf '%s\n' "$SOURCE_SHA" > release-assets/SOURCE_COMMIT
193203 (cd release-assets && sha256sum ./Buzz_* > SHA256SUMS)
194204 - name : Publish desktop previews
@@ -201,10 +211,10 @@ jobs:
201211 gh release create "v$VERSION" release-assets/* \
202212 --target "$SOURCE_SHA" --prerelease --latest=false \
203213 --title "Buzz $VERSION (desktop preview)" \
204- --notes "Desktop preview from commit $SOURCE_SHA, built by Actions run $GITHUB_RUN_ID. Includes Apple Silicon macOS (signed and notarized), Windows x64 (unsigned NSIS installer), and Linux x64 (Ubuntu 24.04 deb and AppImage). Windows/Linux require manual installation and desktop acceptance; only macOS uses the preview updater feed."
214+ --notes "Desktop preview from commit $SOURCE_SHA, built by Actions run $GITHUB_RUN_ID. Includes Apple Silicon macOS (signed and notarized), Windows x64 (unsigned NSIS installer), and Linux x64 (Ubuntu 24.04 deb and AppImage). Windows/Linux still require desktop acceptance. Updater-enabled installs update from the preview feed."
205215
206216 promote_preview :
207- name : Promote verified macOS preview
217+ name : Promote verified preview
208218 needs : [build, publish]
209219 # Explicit promotions skip build/publish; automatic promotions require both to succeed.
210220 if : >-
@@ -228,27 +238,27 @@ jobs:
228238 set -euo pipefail
229239 # Validate the version before using it in release asset paths.
230240 [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+-preview\.[0-9]+\.[0-9]+$ ]] || exit 1
231- export archive="Buzz_${VERSION}_aarch64.app.tar.gz"
241+ archive="Buzz_${VERSION}_aarch64.app.tar.gz"
232242 mkdir -p "$RUNNER_TEMP/candidate" "$RUNNER_TEMP/current" "$RUNNER_TEMP/served"
233- gh release view "v$VERSION" --json assets, isPrerelease --jq \
234- '.isPrerelease and (any(.assets[]; .name == env. archive and .size > 0)) and (any(.assets[]; .name == (env.archive + ".sig") and .size > 0))' | grep -qx true
235- gh release download "v$VERSION" --pattern "$archive " --dir "$RUNNER_TEMP/candidate"
236- gh release download "v$VERSION" --pattern "$archive.sig" --dir "$RUNNER_TEMP/candidate"
237- test -s "$RUNNER_TEMP/candidate/$archive" && test -s "$RUNNER_TEMP/candidate/$archive.sig"
243+ gh release view "v$VERSION" --json isPrerelease --jq .isPrerelease | grep -qx true
244+ for asset in "$ archive" "Buzz_${VERSION}_x64_unsigned.exe" "Buzz_${VERSION}_amd64.deb" "Buzz_${VERSION}_x86_64.AppImage"; do
245+ gh release download "v$VERSION" --pattern "$asset" --pattern "$asset.sig " --dir "$RUNNER_TEMP/candidate"
246+ [[ -s "$RUNNER_TEMP/candidate/$asset" && -s "$RUNNER_TEMP/candidate/$asset.sig" ]]
247+ done
238248 tar -xOzf "$RUNNER_TEMP/candidate/$archive" 'Buzz Foundation.app/Contents/MacOS/buzz-foundation' > "$RUNNER_TEMP/candidate/buzz-foundation"
239249 test -s "$RUNNER_TEMP/candidate/buzz-foundation"
240250 current=''
241251 if gh release view preview-feed >/dev/null 2>&1; then
242252 gh release download preview-feed --pattern latest.json --dir "$RUNNER_TEMP/current"
243253 current="$RUNNER_TEMP/current/latest.json"
244254 fi
245- node scripts/preview-feed.mjs generate "$VERSION" "$RUNNER_TEMP/candidate/$archive.sig " "$RUNNER_TEMP/candidate/latest.json" "$RUNNER_TEMP/candidate/$archive " "$RUNNER_TEMP/candidate/buzz-foundation" ${current:+"$current"}
246- node scripts/preview-feed.mjs verify "$VERSION" "$RUNNER_TEMP/candidate/$archive.sig " "$RUNNER_TEMP/candidate/latest.json" "$RUNNER_TEMP/candidate/$archive " "$RUNNER_TEMP/candidate/buzz-foundation" ${current:+"$current"}
255+ node scripts/preview-feed.mjs generate "$VERSION" "$RUNNER_TEMP/candidate" "$RUNNER_TEMP/candidate/latest.json" "$RUNNER_TEMP/candidate/buzz-foundation" ${current:+"$current"}
256+ node scripts/preview-feed.mjs verify "$VERSION" "$RUNNER_TEMP/candidate" "$RUNNER_TEMP/candidate/latest.json" "$RUNNER_TEMP/candidate/buzz-foundation" ${current:+"$current"}
247257 if [[ -z "$current" ]]; then
248258 gh release create preview-feed "$RUNNER_TEMP/candidate/latest.json" \
249259 --target "$GITHUB_SHA" --prerelease --latest=false \
250- --title 'Buzz macOS preview updater feed' \
251- --notes 'Rolling manifest for manually validated macOS previews. Not the stable channel.'
260+ --title 'Buzz preview updater feed' \
261+ --notes 'Rolling manifest for desktop previews. Not the stable channel.'
252262 elif cmp -s "$RUNNER_TEMP/candidate/latest.json" "$current"; then
253263 echo 'Preview feed already points to this candidate.'
254264 else
@@ -308,6 +318,8 @@ jobs:
308318 run : pnpm tauri build --ci --no-sign --bundles nsis --config "$RUNNER_TEMP/candidate.json" -- --locked
309319 - name : Install into disposable runner and verify app executable
310320 shell : pwsh
321+ env :
322+ CANDIDATES : ${{ inputs.candidates }}
311323 run : |
312324 $installers = @(Get-ChildItem target/release/bundle/nsis/*.exe)
313325 if ($installers.Count -ne 1) { throw 'Expected exactly one NSIS installer' }
@@ -316,6 +328,12 @@ jobs:
316328 $process = Start-Process $installers[0].FullName -ArgumentList "/S /D=$destination" -Wait -PassThru
317329 if ($process.ExitCode -ne 0) { throw "Installer failed: $($process.ExitCode)" }
318330 if (!(Test-Path "$destination\buzz-foundation.exe")) { throw 'App executable missing' }
331+ if ($env:CANDIDATES -ne 'true') {
332+ $binary = [Text.Encoding]::ASCII.GetString([IO.File]::ReadAllBytes("$destination\buzz-foundation.exe"))
333+ foreach ($value in @($env:BUZZ_UPDATER_PUBLIC_KEY, $env:BUZZ_UPDATER_ENDPOINT)) {
334+ if (!$value -or !$binary.Contains($value)) { throw 'App executable does not embed the updater configuration' }
335+ }
336+ }
319337 - name : Stage candidate and checksum
320338 run : |
321339 mkdir release-assets
@@ -374,6 +392,8 @@ jobs:
374392 - name : Build deb and AppImage
375393 run : pnpm tauri build --ci --no-sign --bundles deb,appimage --config "$RUNNER_TEMP/candidate.json" -- --locked
376394 - name : Repair AppImage and verify packaged app executables
395+ env :
396+ CANDIDATES : ${{ inputs.candidates }}
377397 run : |
378398 shopt -s nullglob
379399 debs=(target/release/bundle/deb/*.deb)
@@ -387,6 +407,17 @@ jobs:
387407 (cd "$RUNNER_TEMP/appimage" && "$image" --appimage-extract >/dev/null)
388408 test -x "$RUNNER_TEMP/appimage/squashfs-root/usr/bin/buzz-foundation"
389409 test -x "$RUNNER_TEMP/appimage/squashfs-root/usr/bin/buzz-foundation.bin"
410+ # The updater selects each install's feed entry by its embedded bundle type.
411+ binaries=("$RUNNER_TEMP/deb/usr/bin/buzz-foundation" "$RUNNER_TEMP/appimage/squashfs-root/usr/bin/buzz-foundation.bin")
412+ grep -aqF __TAURI_BUNDLE_TYPE_VAR_DEB "${binaries[0]}" || { echo '::error::deb app lacks its bundle type'; exit 1; }
413+ grep -aqF __TAURI_BUNDLE_TYPE_VAR_APP "${binaries[1]}" || { echo '::error::AppImage app lacks its bundle type'; exit 1; }
414+ if [[ "$CANDIDATES" != true ]]; then
415+ for binary in "${binaries[@]}"; do
416+ for value in "$BUZZ_UPDATER_PUBLIC_KEY" "$BUZZ_UPDATER_ENDPOINT"; do
417+ [[ -n "$value" ]] && grep -aqF "$value" "$binary" || { echo "::error::$binary does not embed the updater configuration"; exit 1; }
418+ done
419+ done
420+ fi
390421 mkdir release-assets
391422 cp "${debs[0]}" "release-assets/Buzz_${VERSION}_amd64.deb"
392423 cp "${images[0]}" "release-assets/Buzz_${VERSION}_x86_64.AppImage"
@@ -399,3 +430,45 @@ jobs:
399430 path : release-assets/
400431 if-no-files-found : error
401432 retention-days : 7
433+
434+ updater_signatures :
435+ # Installer jobs never receive the signing key; sign their verified bytes here.
436+ if : github.repository == 'block/buzz-app' && github.ref == 'refs/heads/main' && !inputs.candidates && !inputs.promote_version
437+ name : Sign Windows and Linux updater installers
438+ needs : [windows, linux]
439+ runs-on : ubuntu-latest
440+ timeout-minutes : 15
441+ steps :
442+ - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
443+ with :
444+ persist-credentials : false
445+ - uses : ./.github/actions/setup
446+ - uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
447+ with :
448+ name : windows-x64-candidate
449+ path : build-assets/windows
450+ - uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
451+ with :
452+ name : linux-x64-candidates
453+ path : build-assets/linux
454+ - name : Sign verified installers
455+ env :
456+ TAURI_SIGNING_PRIVATE_KEY : ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
457+ TAURI_SIGNING_PRIVATE_KEY_PASSWORD : ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
458+ run : |
459+ set -euo pipefail
460+ for platform in windows linux; do
461+ (cd "build-assets/$platform" && sha256sum --check SHA256SUMS)
462+ done
463+ mkdir signatures
464+ for installer in build-assets/windows/*.exe build-assets/linux/*.deb build-assets/linux/*.AppImage; do
465+ pnpm tauri signer sign "$installer"
466+ test -s "$installer.sig" || { echo '::error::Updater signing failed'; exit 1; }
467+ mv "$installer.sig" signatures/
468+ done
469+ - uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
470+ with :
471+ name : windows-linux-updater-signatures
472+ path : signatures/
473+ if-no-files-found : error
474+ retention-days : 7
0 commit comments