Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Node.js Package to npm and gpr | |
# trigger when a release is created | |
on: | |
push: | |
tags: | |
- "**" | |
jobs: | |
build: | |
permissions: | |
contents: read | |
id-token: write | |
packages: write | |
attestations: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "22.x" | |
- uses: pnpm/action-setup@v4 | |
- run: pnpm install | |
- run: pnpm test | |
# publish to npm | |
publish-npm: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "22.x" | |
registry-url: https://registry.npmjs.org/ | |
- uses: pnpm/action-setup@v4 | |
- run: pnpm npm install | |
- run: pnpm npm run build | |
- run: pnpm npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.PUBLISH_NPM_TOKEN}} | |
# publish to gpr | |
# publish-gpr: | |
# needs: build | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - uses: actions/setup-node@v4 | |
# with: | |
# node-version: "22.x" | |
# registry-url: https://npm.pkg.github.com/ | |
# scope: "@cyn" | |
# - uses: pnpm/action-setup@v4 | |
# - run: pnpm install | |
# - run: pnpm run build | |
# - run: pnpm publish | |
# env: | |
# NODE_AUTH_TOKEN: ${{secrets.PUBLISH_GITHUB_TOKEN}} |