From 7465ab71be075f40e126f2816d2b12573cb06d23 Mon Sep 17 00:00:00 2001 From: Jack Amadeo Date: Tue, 27 Oct 2026 16:53:04 +0000 Subject: [PATCH] Build the release candidate even if there are conflicts (#12780) --- .github/workflows/create-release-branch.yaml | 13 +++++++ .github/workflows/patch-release.yaml | 13 +++++++ .github/workflows/release-branches.yml | 37 ++++++++++++++++++-- 3 files changed, 60 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create-release-branch.yaml b/.github/workflows/create-release-branch.yaml index 7200ba772..f7193c20e 100644 --- a/.github/workflows/create-release-branch.yaml +++ b/.github/workflows/create-release-branch.yaml @@ -8,6 +8,7 @@ on: - main permissions: + actions: write contents: write pull-requests: write @@ -80,6 +81,18 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Pushes using GITHUB_TOKEN do not trigger push workflows. + - name: Build initial release candidate + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASE_BRANCH: ${{ env.branch_name }} + BUILD_SHA: ${{ env.head_ref }} + run: | + gh workflow run release-branches.yml \ + --ref main \ + -f release_branch="$RELEASE_BRANCH" \ + -f build_sha="$BUILD_SHA" + - name: Post release checklist comment run: | sed 's/{{VERSION}}/${{ env.version }}/g' RELEASE_CHECKLIST.md > checklist_comment.md diff --git a/.github/workflows/patch-release.yaml b/.github/workflows/patch-release.yaml index d47e41d4a..6b5060518 100644 --- a/.github/workflows/patch-release.yaml +++ b/.github/workflows/patch-release.yaml @@ -1,6 +1,7 @@ name: Create Patch Release permissions: + actions: write contents: write pull-requests: write @@ -86,6 +87,18 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Pushes using GITHUB_TOKEN do not trigger push workflows. + - name: Build initial release candidate + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASE_BRANCH: ${{ env.branch_name }} + BUILD_SHA: ${{ env.head_ref }} + run: | + gh workflow run release-branches.yml \ + --ref main \ + -f release_branch="$RELEASE_BRANCH" \ + -f build_sha="$BUILD_SHA" + - name: Post release checklist comment run: | sed 's/{{VERSION}}/${{ env.version }}/g' RELEASE_CHECKLIST.md > checklist_comment.md diff --git a/.github/workflows/release-branches.yml b/.github/workflows/release-branches.yml index 74721d9ba..0555fbb81 100644 --- a/.github/workflows/release-branches.yml +++ b/.github/workflows/release-branches.yml @@ -1,15 +1,31 @@ name: Build goose release candidate on: - pull_request: + push: + branches: + - 'release/**' + workflow_dispatch: + inputs: + release_branch: + description: 'Release branch whose PR receives the download link' + required: true + type: string + build_sha: + description: 'Exact commit SHA to build' + required: true + type: string + +concurrency: + group: release-candidate-${{ inputs.build_sha || github.sha }} + cancel-in-progress: true jobs: bundle-desktop: - if: startsWith(github.head_ref, 'release/') uses: ./.github/workflows/bundle-macos.yml permissions: contents: read with: + ref: ${{ inputs.build_sha || github.sha }} target: aarch64-apple-darwin package_cli: false package_desktop: true @@ -20,10 +36,25 @@ jobs: permissions: pull-requests: write steps: + - name: Find release PR + id: release-pr + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + RELEASE_BRANCH: ${{ inputs.release_branch || github.ref_name }} + with: + script: | + const { data: prs } = await github.rest.pulls.list({ + ...context.repo, + state: 'open', + head: `${context.repo.owner}:${process.env.RELEASE_BRANCH}`, + }); + core.setOutput('number', prs[0]?.number ?? ''); + - name: Comment with download link + if: steps.release-pr.outputs.number != '' uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 with: - issue-number: ${{ github.event.number }} + issue-number: ${{ steps.release-pr.outputs.number }} body: | ### macOS ARM64 Desktop App (Apple Silicon)