diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 59b8727d..4e5af45d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -212,13 +212,18 @@ jobs: echo "RELEASE_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV echo "RELEASE_VERSION=${RELEASE_TAG:1}" >> $GITHUB_ENV - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 https://github.com/actions/checkout/releases/tag/v4.2.2 + if: startsWith(github.ref, 'refs/tags/') - name: setup nodejs uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 https://github.com/actions/setup-node/releases/tag/v4.4.0 + if: startsWith(github.ref, 'refs/tags/') with: node-version: '23.x' + registry-url: 'https://registry.npmjs.org' - name: Update package.json run: sed -e "s/0.999.0/${RELEASE_VERSION}/" .github/package.json > package.json + if: startsWith(github.ref, 'refs/tags/') - name: Publish to NPM run: npm publish --provenance --access public + if: startsWith(github.ref, 'refs/tags/') env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}