fix(release): make desktop tagging squash-safe (#3965)

## Summary
- validate desktop release candidates before merge and keep the
repository squash-only
- tag the squash commit only after proving frozen-base parent and
complete-tree identity with the validated PR head
- accept either an exact-head approval or the durable Default-ruleset
bypass record as release authorization
- remove the unusable App-backed preparation workflow; retain `just
release-desktop`

## Ruleset follow-up
After this PR merges, update Default ruleset `13596885` to:
- enable strict required status checks
- dismiss stale reviews on push and require approval after the last push
- require the integration-bound `Desktop Release Candidate` check

The next desktop release should be cut only after that settings update.

## Verification
At commit `d8c254db427eedbcffac1a6e078e90d1d0f5e151` with a clean
worktree:
- `scripts/test-release-ref-contract.sh`
- `scripts/test-desktop-release-candidate.sh`
- `bash -n scripts/verify-desktop-release-merge.sh
scripts/prepare-desktop-release.sh scripts/test-release-ref-contract.sh`
- `git diff --check`

The bypass test fixture is the captured rule-suite shape from real
squash merge PR #2864 / suite `3520068134`.

---------

Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Carl <c7ebe626f000404285d3686e1dc74cc07cc60a9754a150041ba132e14bd3e2ec@buzz.block.builderlab.xyz>
This commit is contained in:
Wes
2026-07-31 11:03:51 -07:00
committed by GitHub
co-authored by Carl
parent bb34bc4d98
commit db7e84d4f8
9 changed files with 135 additions and 92 deletions
@@ -91,7 +91,7 @@ jobs:
echo "enabled=true"
echo "tag=${TAG_PREFIX}${VERSION}"
if [[ "$TAG_PREFIX" == desktop-v ]]; then
echo "target_sha=${{ github.event.pull_request.head.sha }}"
echo "target_sha=${{ github.event.pull_request.merge_commit_sha }}"
echo "desktop=true"
else
echo "target_sha=$GITHUB_SHA"
@@ -111,7 +111,7 @@ jobs:
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
PR_HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
PR_PUSHER: ${{ github.event.pull_request.head.user.login }}
MERGED_BY: ${{ github.event.pull_request.merged_by.login }}
MERGE_SHA: ${{ github.event.pull_request.merge_commit_sha }}
run: |
VERSION="${VERSION#desktop-v}"
@@ -0,0 +1,26 @@
name: Desktop Release Candidate
on:
pull_request:
branches: [main]
permissions:
contents: read
jobs:
validate:
name: Desktop Release Candidate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
persist-credentials: false
- name: Validate immutable desktop candidate
if: startsWith(github.event.pull_request.head.ref, 'version-bump/')
env:
VERSION: ${{ github.event.pull_request.head.ref }}
run: |
VERSION="${VERSION#version-bump/}"
scripts/desktop_release.py validate --candidate HEAD --version "$VERSION" --repo "$GITHUB_REPOSITORY"
@@ -1,38 +0,0 @@
name: Prepare Desktop Release
on:
workflow_dispatch:
inputs:
version:
description: Semver to prepare (for example 0.5.1)
required: true
env:
RELEASE_AUTOMATION_NAME: Carl
RELEASE_AUTOMATION_EMAIL: c7ebe626f000404285d3686e1dc74cc07cc60a9754a150041ba132e14bd3e2ec@buzz.block.builderlab.xyz
jobs:
prepare:
if: github.repository == 'block/buzz'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Create short-lived release preparer token
id: preparer
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.BUZZ_RELEASE_TAGGER_CLIENT_ID }}
private-key: ${{ secrets.BUZZ_RELEASE_TAGGER_PRIVATE_KEY }}
permission-contents: write
permission-pull-requests: write
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0
token: ${{ steps.preparer.outputs.token }}
- uses: cashapp/activate-hermit@cea9af7913204a965fd488637a8d1811bba2e616 # v1
- name: Prepare immutable candidate and open or update PR
env:
GH_TOKEN: ${{ steps.preparer.outputs.token }}
VERSION: ${{ inputs.version }}
run: scripts/prepare-desktop-release.sh "$VERSION"