From 49dc86324cd946a07250334292e94f41ba355333 Mon Sep 17 00:00:00 2001 From: Filip Seman Date: Sat, 3 Aug 2024 21:52:33 +0200 Subject: [PATCH 1/3] ci: add release please with provenance --- .github/.release-please-manifest.json | 3 ++ .github/release-please-config.json | 27 ++++++++++++++++ .github/workflows/release-please.yml | 46 +++++++++++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 .github/.release-please-manifest.json create mode 100644 .github/release-please-config.json create mode 100644 .github/workflows/release-please.yml diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json new file mode 100644 index 0000000..884c29a --- /dev/null +++ b/.github/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "1.7.1" +} diff --git a/.github/release-please-config.json b/.github/release-please-config.json new file mode 100644 index 0000000..af23b09 --- /dev/null +++ b/.github/release-please-config.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "packages": { + ".": { + "release-type": "node", + "include-v-in-tag": true, + "include-component-in-tag": false, + "pull-request-title-pattern": "v${version}", + "pull-request-header": "", + "pull-request-footer": "" + } + }, + "changelog-sections": [ + { "type": "feat", "section": "Features" }, + { "type": "fix", "section": "Bug Fixes" }, + { "type": "perf", "section": "Performance Improvements" }, + { "type": "deps", "section": "Dependency updates" }, + { "type": "docs", "section": "Documentation" }, + { "type": "ci", "section": "Maintenance" }, + { "type": "build", "section": "Maintenance" }, + { "type": "chore", "section": "Maintenance" }, + { "type": "refactor", "section": "Refactors" }, + { "type": "test", "section": "Tests" }, + { "type": "style", "section": "Code Style", "hidden": true }, + { "type": "examples", "section": "Examples", "hidden": true } + ] +} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..a670ccd --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,46 @@ +name: release-please + +on: + workflow_run: + workflows: [tests] + types: + - completed + # manual + workflow_dispatch: + inputs: + publish-release: + description: Publish the release? + required: true + default: "false" + +permissions: + contents: write + pull-requests: write + id-token: write + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: googleapis/release-please-action@v4 + id: release + with: + manifest-file: .github/.release-please-manifest.json + config-file: .github/release-please-config.json + + - if: ${{ github.event.inputs.publish-release == 'true' || steps.release.outputs.release_created }} + uses: actions/checkout@v4 + + - if: ${{ github.event.inputs.publish-release == 'true' || steps.release.outputs.release_created }} + uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + registry-url: "https://registry.npmjs.org" + + - if: ${{ github.event.inputs.publish-release == 'true' || steps.release.outputs.release_created }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: > + npm ci && + npm run build && + npm publish --provenance --access public From 60758af3695ae04c34410c073ba6fdc7e0d858a3 Mon Sep 17 00:00:00 2001 From: Filip Seman Date: Sat, 3 Aug 2024 21:55:30 +0200 Subject: [PATCH 2/3] ci: update setup-node --- .github/workflows/release-please.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index a670ccd..63ab568 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -33,9 +33,6 @@ jobs: - if: ${{ github.event.inputs.publish-release == 'true' || steps.release.outputs.release_created }} uses: actions/setup-node@v4 - with: - node-version-file: ".nvmrc" - registry-url: "https://registry.npmjs.org" - if: ${{ github.event.inputs.publish-release == 'true' || steps.release.outputs.release_created }} env: From ac61d245b4ee9dd076732ea46e89a4d1e1aad5c2 Mon Sep 17 00:00:00 2001 From: Filip Seman Date: Mon, 12 Aug 2024 15:04:07 +0200 Subject: [PATCH 3/3] ci: update release --- .github/workflows/release-please.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 63ab568..4945e2b 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -2,7 +2,8 @@ name: release-please on: workflow_run: - workflows: [tests] + workflows: + - QA types: - completed # manual