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@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "22.x" | |
- run: npm ci | |
- run: npm test | |
# publish to npm | |
publish-npm: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "22.x" | |
registry-url: https://registry.npmjs.org/ | |
- run: npm ci | |
- run: npm run build | |
- run: 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@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "22.x" | |
registry-url: https://npm.pkg.github.com/ | |
scope: "@cyn" | |
- run: npm ci | |
- run: npm run build | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.PUBLISH_GITHUB_TOKEN}} |