From 6ed60a468a91fa8db59d730afcdfc62629e27a7d Mon Sep 17 00:00:00 2001 From: brovatten Date: Sat, 6 Jun 2026 19:05:22 +0200 Subject: [PATCH] ci: automate releases with release-please Conventional Commits -> version bump + CHANGELOG + GitHub Release. Merging the auto-generated 'chore: release X.Y.Z' PR cuts the release; the workflow then re-points the moving major tag (v1 -> vX.Y.Z). Seeded at 0.1.2; the first release is pinned to 1.0.0 via the trailer below. Release-As: 1.0.0 --- .github/workflows/release-please.yml | 41 ++++++++++++++++++++++++++++ .release-please-manifest.json | 3 ++ release-please-config.json | 10 +++++++ 3 files changed, 54 insertions(+) create mode 100644 .github/workflows/release-please.yml create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..a1a98f3 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,41 @@ +name: release-please + +# Automated releases from Conventional Commits. On each push to main, release- +# please maintains a "chore: release X.Y.Z" PR (version bump + CHANGELOG). Merge +# that PR to cut the release: it tags vX.Y.Z, creates the GitHub Release, and the +# step below re-points the moving major tag (e.g. v1 -> v1.2.0). + +on: + push: + branches: [main] + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: googleapis/release-please-action@v4 + id: release + with: + token: ${{ secrets.GITHUB_TOKEN }} + + # Move the moving major tag here rather than in release-major-tag.yml: a + # release created with GITHUB_TOKEN does NOT trigger other workflows, so the + # `release: published` listener wouldn't fire for release-please releases. + - uses: actions/checkout@v4 + if: ${{ steps.release.outputs.release_created }} + with: + fetch-depth: 0 + - name: Update major tag + if: ${{ steps.release.outputs.release_created }} + env: + TAG: ${{ steps.release.outputs.tag_name }} + MAJOR: ${{ steps.release.outputs.major }} + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git tag -fa "v${MAJOR}" -m "v${MAJOR} -> ${TAG}" "${TAG}" + git push origin "v${MAJOR}" --force diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..001eb2c --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.1.2" +} diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..22ecaa3 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "include-component-in-tag": false, + "packages": { + ".": { + "release-type": "simple", + "package-name": "codeboarding-action" + } + } +}