Publish package to GPR #3
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: Publish package to GPR | |
on: | |
workflow_dispatch: | |
inputs: | |
release: | |
description: 'Release to publish to GPR' | |
required: true | |
default: 'v1.0.0' | |
env: | |
CI: true | |
jobs: | |
test-build-publish: | |
permissions: | |
contents: write | |
packages: write | |
name: Publish package to GPR | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.release }} | |
registry-url: https://npm.pkg.github.com | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Set version | |
run: npm version ${{ github.event.inputs.release }} --allow-same-version --git-tag-version=false | |
- name: Install dependencies | |
run: npm ci | |
- name: Test | |
run: npm run test:coverage | |
- name: Build | |
run: npm run build | |
- name: Publish | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |