From ddbcac455fb187ab22e67ab042618e48454ff71a Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Thu, 11 Sep 2025 19:40:18 +0200 Subject: [PATCH] ci: Use `release-please` to publish releases --- .github/workflows/release-please.yml | 38 ++++++++++++++++++++++++++++ .release-please-manifest.json | 3 +++ release-please-config.json | 10 ++++++++ 3 files changed, 51 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..d14a8f0 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,38 @@ +name: release-please + +on: + push: + branches: + - main + +permissions: + id-token: write # Required for OIDC + contents: write + issues: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + outputs: + release_created: ${{ steps.release.outputs.release_created }} + steps: + - uses: googleapis/release-please-action@v4 + id: release + with: + token: ${{ secrets.RELEASE_PLEASE_GITHUB_TOKEN }} + config-file: release-please-config.json + manifest-file: .release-please-manifest.json + + npm-publish: + needs: release-please + if: ${{ needs.release-please.outputs.release_created }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: lts/* + registry-url: 'https://registry.npmjs.org' + - run: npm install -g npm@latest + - run: npm publish --access public \ No newline at end of file diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..5c3c8dd --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.1.1" +} \ No newline at end of file diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..2681dbb --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "bootstrap-sha": "1c22711a6e83410aba124e56d1a87e2d60f9c068", + "packages": { + ".": { + "pull-request-title-pattern": "chore: release v${version}", + "release-type": "node" + } + } +} \ No newline at end of file