77 description : Build Windows/Linux candidates only (no publishing or macOS signing)
88 type : boolean
99 default : false
10+ promote_version :
11+ description : Promote a validated version (e.g. 0.0.0-preview.22.1) to the macOS preview updater feed; no build
12+ type : string
13+ default : " "
1014 schedule :
1115 - cron : " 17 */6 * * *"
1216
@@ -19,7 +23,7 @@ concurrency:
1923
2024jobs :
2125 build :
22- if : github.repository == 'block/buzz-app' && !inputs.candidates
26+ if : github.repository == 'block/buzz-app' && !inputs.candidates && !inputs.promote_version
2327 name : Build, sign, and notarize
2428 runs-on : macos-latest
2529 timeout-minutes : 120
@@ -31,15 +35,21 @@ jobs:
3135 env :
3236 CI : " true"
3337 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
3441 steps :
3542 - name : Require main and signing configuration
3643 env :
3744 SOURCE_REF : ${{ github.ref }}
3845 SIGNING_ROLE : ${{ secrets.OSX_CODESIGN_ROLE }}
3946 SIGNING_BUCKET : ${{ secrets.CODESIGN_S3_BUCKET }}
47+ UPDATER_KEY : ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
48+ UPDATER_PASSWORD : ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
4049 run : |
4150 test "$SOURCE_REF" = refs/heads/main || { echo '::error::Releases must run from main'; exit 1; }
4251 test -n "$SIGNING_ROLE" && test -n "$SIGNING_BUCKET" || { echo '::error::Set OSX_CODESIGN_ROLE and CODESIGN_S3_BUCKET'; exit 1; }
52+ test -n "$UPDATER_KEY" && test -n "$UPDATER_PASSWORD" || { echo '::error::Set TAURI_SIGNING_PRIVATE_KEY and TAURI_SIGNING_PRIVATE_KEY_PASSWORD'; exit 1; }
4353
4454 - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
4555 with :
@@ -59,16 +69,20 @@ jobs:
5969 const base = config.version.split('-')[0];
6070 if (!/^\d+\.\d+\.\d+$/.test(base)) throw new Error('Expected a numeric Tauri version');
6171 const version = `${base}-preview.${process.env.GITHUB_RUN_NUMBER}.${process.env.GITHUB_RUN_ATTEMPT}`;
62- writeFileSync(`${process.env.RUNNER_TEMP}/release.json`, JSON.stringify({ version, bundle: { createUpdaterArtifacts: false } }));
72+ writeFileSync(`${process.env.RUNNER_TEMP}/release.json`, JSON.stringify({
73+ version,
74+ bundle: { createUpdaterArtifacts: false },
75+ plugins: { updater: { pubkey: process.env.BUZZ_UPDATER_PUBLIC_KEY, endpoints: [process.env.BUZZ_UPDATER_ENDPOINT] } },
76+ }));
6377 appendFileSync(process.env.GITHUB_OUTPUT, `version=${version}\n`);
6478 JS
6579
6680 - name : Build unsigned app and DMG
81+ env :
82+ TAURI_BUNDLER_DMG_IGNORE_CI : " true"
6783 run : |
6884 rm -rf target/release/bundle
6985 pnpm tauri build --ci --no-sign --bundles dmg --config "$RUNNER_TEMP/release.json" -- --locked
70- env :
71- TAURI_BUNDLER_DMG_IGNORE_CI : " true"
7286
7387 - name : Locate unsigned DMG
7488 id : unsigned
@@ -116,15 +130,32 @@ jobs:
116130 }
117131 JS
118132
119- - name : Stage release asset and checksum
133+ - name : Stage release assets and checksums
120134 env :
121135 SIGNED_DMG : ${{ steps.codesign.outputs.signed-dmg-path }}
122136 VERSION : ${{ steps.version.outputs.version }}
137+ TAURI_SIGNING_PRIVATE_KEY : ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
138+ TAURI_SIGNING_PRIVATE_KEY_PASSWORD : ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
123139 run : |
140+ set -euo pipefail
124141 mkdir release-assets
125142 cp "$SIGNED_DMG" "release-assets/Buzz_${VERSION}_aarch64.dmg"
126- cd release-assets
127- shasum -a 256 ./*.dmg > SHA256SUMS
143+
144+ # Package the verified, Apple-signed and stapled app from the release DMG.
145+ app_dir=$(mktemp -d "$RUNNER_TEMP/updater-app.XXXXXX")
146+ hdiutil attach "$SIGNED_DMG" -readonly -nobrowse -mountpoint "$app_dir" >/dev/null
147+ trap 'hdiutil detach "$app_dir" >/dev/null' EXIT
148+ app="$app_dir/Buzz Foundation.app"
149+ test -d "$app" || { echo '::error::Signed DMG contains no app'; exit 1; }
150+ archive="$PWD/release-assets/Buzz_${VERSION}_aarch64.app.tar.gz"
151+ # ditto copies the complete signed bundle (including symlinks and metadata).
152+ staged_app=$(mktemp -d "$RUNNER_TEMP/updater-staging.XXXXXX")
153+ ditto "$app" "$staged_app/Buzz Foundation.app"
154+ codesign --verify --deep --strict "$staged_app/Buzz Foundation.app"
155+ (cd "$staged_app" && COPYFILE_DISABLE=1 tar -czf "$archive" 'Buzz Foundation.app')
156+ pnpm tauri signer sign "$archive"
157+ test -s "$archive" && test -s "$archive.sig" || { echo '::error::Updater signing failed'; exit 1; }
158+ (cd release-assets && shasum -a 256 ./*.dmg ./*.tar.gz > SHA256SUMS)
128159
129160 - uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
130161 with :
@@ -157,6 +188,60 @@ jobs:
157188 --title "Buzz $VERSION (macOS preview)" \
158189 --notes "Apple Silicon macOS preview from commit $SOURCE_SHA. Built, signed, and notarized by Actions run $GITHUB_RUN_ID."
159190
191+ promote_preview :
192+ name : Promote verified macOS preview
193+ needs : [build, publish]
194+ # Explicit promotions skip build/publish; automatic promotions require both to succeed.
195+ if : >-
196+ ${{ !cancelled() && github.repository == 'block/buzz-app' && github.ref == 'refs/heads/main' && !inputs.candidates &&
197+ ((inputs.promote_version != '' && needs.build.result == 'skipped' && needs.publish.result == 'skipped') ||
198+ (inputs.promote_version == '' && needs.build.result == 'success' && needs.publish.result == 'success')) }}
199+ runs-on : ubuntu-latest
200+ timeout-minutes : 10
201+ permissions :
202+ contents : write
203+ steps :
204+ - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
205+ with :
206+ persist-credentials : false
207+ - name : Verify and publish preview feed
208+ env :
209+ GH_TOKEN : ${{ github.token }}
210+ GH_REPO : ${{ github.repository }}
211+ VERSION : ${{ inputs.promote_version || needs.build.outputs.version }}
212+ run : |
213+ set -euo pipefail
214+ # Validate the version before using it in release asset paths.
215+ [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+-preview\.[0-9]+\.[0-9]+$ ]] || exit 1
216+ export archive="Buzz_${VERSION}_aarch64.app.tar.gz"
217+ mkdir -p "$RUNNER_TEMP/candidate" "$RUNNER_TEMP/current" "$RUNNER_TEMP/served"
218+ gh release view "v$VERSION" --json assets,isPrerelease --jq \
219+ '.isPrerelease and (any(.assets[]; .name == env.archive and .size > 0)) and (any(.assets[]; .name == (env.archive + ".sig") and .size > 0))' | grep -qx true
220+ gh release download "v$VERSION" --pattern "$archive" --dir "$RUNNER_TEMP/candidate"
221+ gh release download "v$VERSION" --pattern "$archive.sig" --dir "$RUNNER_TEMP/candidate"
222+ test -s "$RUNNER_TEMP/candidate/$archive" && test -s "$RUNNER_TEMP/candidate/$archive.sig"
223+ tar -xOzf "$RUNNER_TEMP/candidate/$archive" 'Buzz Foundation.app/Contents/MacOS/buzz-foundation' > "$RUNNER_TEMP/candidate/buzz-foundation"
224+ test -s "$RUNNER_TEMP/candidate/buzz-foundation"
225+ current=''
226+ if gh release view preview-feed >/dev/null 2>&1; then
227+ gh release download preview-feed --pattern latest.json --dir "$RUNNER_TEMP/current"
228+ current="$RUNNER_TEMP/current/latest.json"
229+ fi
230+ 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"}
231+ 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"}
232+ if [[ -z "$current" ]]; then
233+ gh release create preview-feed "$RUNNER_TEMP/candidate/latest.json" \
234+ --target "$GITHUB_SHA" --prerelease --latest=false \
235+ --title 'Buzz macOS preview updater feed' \
236+ --notes 'Rolling manifest for manually validated macOS previews. Not the stable channel.'
237+ elif cmp -s "$RUNNER_TEMP/candidate/latest.json" "$current"; then
238+ echo 'Preview feed already points to this candidate.'
239+ else
240+ gh release upload preview-feed "$RUNNER_TEMP/candidate/latest.json" --clobber
241+ fi
242+ gh release download preview-feed --pattern latest.json --dir "$RUNNER_TEMP/served"
243+ cmp "$RUNNER_TEMP/candidate/latest.json" "$RUNNER_TEMP/served/latest.json"
244+
160245 windows :
161246 if : github.repository == 'block/buzz-app' && inputs.candidates
162247 name : Windows x64 candidate (unsigned)
0 commit comments