Skip to content

Commit 7912171

Browse files
ktamas77claude
andcommitted
ci: switch to release-please for automated npm publishing via OIDC
Replace the release-on-published-Release workflow with release-please. On every push to main, conventional commits drive a Release PR that bumps the version and updates CHANGELOG.md. Merging the PR creates a tag + GitHub Release, and the same workflow then runs lint/typecheck/build and publishes to npm with provenance. Authentication uses npm Trusted Publisher (OIDC) — no NPM_TOKEN secret needed. Reverts the manual 0.1.2 bump in package.json/package-lock.json so release-please owns version management going forward. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 71b0ecf commit 7912171

1 file changed

Lines changed: 26 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,44 @@
1-
name: Release to npm
1+
name: Release
22

33
on:
4-
release:
5-
types: [published]
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
id-token: write
611

712
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
release_created: ${{ steps.release.outputs.release_created }}
17+
tag_name: ${{ steps.release.outputs.tag_name }}
18+
steps:
19+
- uses: googleapis/release-please-action@v4
20+
id: release
21+
with:
22+
release-type: node
23+
824
publish:
25+
needs: release-please
26+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
927
runs-on: ubuntu-latest
1028
permissions:
1129
contents: read
1230
id-token: write
1331
steps:
1432
- uses: actions/checkout@v4
33+
with:
34+
ref: ${{ needs.release-please.outputs.tag_name }}
1535
- uses: actions/setup-node@v4
1636
with:
1737
node-version: '20.x'
1838
registry-url: 'https://registry.npmjs.org'
1939
cache: npm
2040
- run: npm ci
41+
- run: npm run lint
42+
- run: npm run typecheck
43+
- run: npm run build
2144
- run: npm publish --provenance --access public
22-
env:
23-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)