From ffeb01e78402957036b805c0e3b5653faed0340b Mon Sep 17 00:00:00 2001 From: Maksym Stoianov Date: Tue, 17 Nov 2026 23:04:54 +0100 Subject: [PATCH] ci(release): tag releases as vX.Y.Z, skip npm publish of an existing version release-please drops the component from the tag (v3.0.0, as in bootgs/boot); last-release-sha points at apps-script-utils-v2.1.1 so the next changelog starts there (remove it after the first v* release). The publish step skips a version that is already on npm, so a release published by hand still gets its signed tarball and SBOM on the GitHub release. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Maksym Stoianov --- .github/workflows/release-please.yml | 12 ++++++++++-- release-please-config.json | 7 ++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index d77b16bc..588401ae 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -9,7 +9,7 @@ on: workflow_dispatch: inputs: tag: - description: "Release tag to publish to npm, e.g. apps-script-utils-v3.0.0" + description: "Release tag to publish to npm, e.g. v3.0.0" required: true # Every job declares only the permissions it needs. @@ -86,10 +86,18 @@ jobs: id: pack run: echo "file=$(npm pack --silent | tail -n 1)" >> "$GITHUB_OUTPUT" + # Skipped when this version is already on npm (for example the first release of a new + # package name, published by hand); the tarball still goes to the GitHub release. - name: publish env: FILE: ${{ steps.pack.outputs.file }} - run: npm publish "./$FILE" --provenance --access public + run: | + spec="$(node -p "require('./package.json').name + '@' + require('./package.json').version")" + if npm view "$spec" version > /dev/null 2>&1; then + echo "$spec is already on npm, not published again" + else + npm publish "./$FILE" --provenance --access public + fi - name: keep-package uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 diff --git a/release-please-config.json b/release-please-config.json index 627ed033..875506b1 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -4,7 +4,6 @@ ".": { "release-type": "node", "package-name": "@bootgs/utils", - "component": "apps-script-utils", "changelog-path": "CHANGELOG.md", "extra-files": [ "docs/writerside/writerside.cfg", @@ -12,7 +11,9 @@ "docs/writerside-uk/writerside.cfg", "docs/writerside-de/writerside.cfg", "docs/writerside-fr/writerside.cfg" - ] + ], + "include-component-in-tag": false } - } + }, + "last-release-sha": "629b147f411517993c1073b8ae0fa784726e2348" }