From 0ae3aafda8a62d498095cb05f8fe4cb37ebc82ce Mon Sep 17 00:00:00 2001 From: Yun Wang Date: Fri, 27 Nov 2026 16:16:21 +0100 Subject: [PATCH] ci(release): wait for an approval before tagging a release The tag job runs in the release environment, so a merged Release PR is tagged only after a reviewer approves, the same as the publish step of the other server-side SDKs. Packagist reads a tag as soon as it exists. --- .github/RELEASE_SETUP.md | 4 ++-- .github/workflows/release.yml | 2 ++ README.md | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/RELEASE_SETUP.md b/.github/RELEASE_SETUP.md index 3bcd9687..fd0b4e74 100644 --- a/.github/RELEASE_SETUP.md +++ b/.github/RELEASE_SETUP.md @@ -49,8 +49,8 @@ This guide explains how to set up automatic publishing to Packagist using GitHub Releases are driven by [release-please](https://github.com/googleapis/release-please). The Releases section of `README.md` is the reference; the short version is that merging a PR with a conventional title updates a bot-authored Release PR, and merging that -Release PR runs the suite, creates the tag and the GitHub Release, and announces the tag -to Packagist. +Release PR, once a reviewer of the `release` environment approves the release run, +creates the tag and the GitHub Release and announces the tag to Packagist. ### Manual Publishing (if needed) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 39cb18e1..aa6a19ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -183,6 +183,8 @@ jobs: && (needs.tests.result == 'success' || needs.tests.result == 'skipped') }} runs-on: { group: github-public-amd64 } timeout-minutes: 5 + # A person approves every release before it is tagged, since Packagist reads a tag as soon as it exists. + environment: release permissions: contents: write issues: write diff --git a/README.md b/README.md index 2053794e..125091c4 100644 --- a/README.md +++ b/README.md @@ -265,7 +265,7 @@ Releases are driven by [release-please](https://github.com/googleapis/release-pl - Its runs are created held at `action_required` until someone clicks **Approve and run**, because release-please opens the PR with `GITHUB_TOKEN`. The unit lane then reports `skipped` and `🧪 Tests` goes green without running a test. The skip only applies while the diff is nothing but what release-please writes, down to the version line in each version file, so a code or dependency change pushed onto a Release PR by hand runs the unit lane like any other PR. -- Merging the Release PR creates the tag and the GitHub Release on that merge commit and announces the tag to Packagist, with no further test run: the Release PR adds only the version bump and changelog to an already-tested `master`. A hotfix release from `N.x` runs the unit lane first, since its commits were pushed without a PR. A tag and a GitHub Release cannot be withdrawn. +- Merging the Release PR starts a release run that waits for a reviewer of the `release` environment to approve it. It then creates the tag and the GitHub Release on that merge commit and announces the tag to Packagist, with no further test run: the Release PR adds only the version bump and changelog to an already-tested `master`. A hotfix release from `N.x` runs the unit lane first, since its commits were pushed without a PR. A tag and a GitHub Release cannot be withdrawn. Packagist reads the tags itself, so the announce step only asks it to look now rather than on its own schedule. If it fails or the credentials are unset, the release still