Skip to content

Publish package to GPR #3

Publish package to GPR

Publish package to GPR #3

Workflow file for this run

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 }}