diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 134ca95..15de360 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -1,8 +1,7 @@ name: Publish to npm on: - release: - types: [published] + workflow_dispatch: permissions: contents: read diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 90b4476..c2c3348 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -9,6 +9,7 @@ permissions: contents: write issues: write pull-requests: write + id-token: write jobs: release-please: @@ -21,3 +22,33 @@ jobs: id: release with: token: ${{ secrets.GITHUB_TOKEN }} + + publish-npm: + needs: release-please + if: needs.release-please.outputs.release_created == 'true' + runs-on: ubuntu-latest + environment: npm + permissions: + contents: read + id-token: write + steps: + - name: Checkout code + uses: actions/checkout@v7 + + - name: Setup Node.js + uses: actions/setup-node@v6 + with: + node-version: '24' + cache: 'npm' + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + - name: Publish to npm + run: npm publish --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}