diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 7cd1538..36824f7 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -8,13 +8,28 @@ jobs: build-and-publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout repo + uses: actions/checkout@v4 + with: + ref: ${{ github.event.release.target_commitish }} + - uses: actions/setup-node@v4 with: node-version: 20 registry-url: https://registry.npmjs.org/ - run: npm ci - run: npm run make - - run: npm publish --access public + + - name: Publish NPM package (regular) + if: !github.event.release.prerelease + run: | + npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}} + + - name: Publish NPM package (pre-release) + if: github.event.release.prerelease + run: | + npm publish --tag next env: - NODE_AUTH_TOKEN: ${{secrets.npm_token}} \ No newline at end of file + NODE_AUTH_TOKEN: ${{secrets.npm_token}}