diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index c231207..649eedf 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -8,6 +8,12 @@ permissions: contents: write pull-requests: write +# Runs merge and tag releases, so two at once could race on the same release +# PR. Queue them instead, and never cancel one partway through a release. +concurrency: + group: release-please + cancel-in-progress: false + jobs: release-please: runs-on: ubuntu-latest @@ -16,6 +22,28 @@ jobs: # the release, writes CHANGELOG.md, and bumps the version in both plugin # manifests via the extra-files config. - uses: googleapis/release-please-action@v4 + id: release + with: + config-file: release-please-config.json + manifest-file: .release-please-manifest.json + + # Every releasable commit ships its own release: merge the release PR as + # soon as it is opened or refreshed. `pr` is unset when there was nothing + # to release, as for docs or ci commits. + - name: Merge the release PR + if: ${{ steps.release.outputs.pr }} + env: + GH_TOKEN: ${{ github.token }} + PR_NUMBER: ${{ fromJSON(steps.release.outputs.pr).number }} + run: gh pr merge "$PR_NUMBER" --squash --repo "$GITHUB_REPOSITORY" + + # A merge made with GITHUB_TOKEN does not trigger this workflow again, so + # run release-please once more to tag and publish what was just merged. + # If this misses it, the next push to main releases it instead, since + # release-please picks up any merged PR still labelled autorelease: pending. + - name: Tag and publish the release + if: ${{ steps.release.outputs.pr }} + uses: googleapis/release-please-action@v4 with: config-file: release-please-config.json manifest-file: .release-please-manifest.json diff --git a/README.md b/README.md index fb19f9d..3610a62 100644 --- a/README.md +++ b/README.md @@ -162,10 +162,12 @@ canned JSONL, which is also how the hang and did-nothing failure modes are reproduced on demand. Commits follow [Conventional Commits](https://www.conventionalcommits.org/). -Releases are cut by release-please: each push to `main` refreshes an open -release PR, and merging it tags the release, writes `CHANGELOG.md`, and bumps -the version everywhere it appears — `version.txt`, both plugin manifests, and -the skill's frontmatter. +Releases are cut by release-please, and every `feat` or `fix` merged to `main` +ships its own release. The workflow opens a release PR and merges it straight +away. That tags the release, writes `CHANGELOG.md`, and bumps the version +everywhere it appears: `version.txt`, both plugin manifests, and each skill's +frontmatter. Commits that release nothing, such as `docs` and `ci`, wait for +the next one that does. ## Licence