Skip to content

Workflow file for this run

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 --access=public --no-git-checks
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 --access=public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{secrets.PUBLISH_GITHUB_TOKEN}}