Publish Package to github packages #7
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: Publish Package to github packages | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
pull-requests: write | |
checks: write | |
steps: | |
- uses: actions/checkout@v4 | |
# Setup .npmrc file to publish to GitHub Packages | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
registry-url: 'https://npm.pkg.github.com' | |
# Defaults to the user or organization that owns the workflow file | |
scope: '@qualipool' | |
###### | |
## Update version and create tag and push to main | |
###### | |
- name: Bump version in package.json | |
uses: reedyuk/npm-version@15e0d016f632fe38bbb704910b8359f23262deb7 # 1.2.2 | |
with: | |
version: ${{ github.event.release.tag_name }} | |
- name: Commit files, create tag and push to remote | |
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4 | |
with: | |
message: ${{ github.event.release.tag_name }} | |
default_author: user_info | |
push: 'true' | |
tag: v${{ github.event.release.tag_name }} | |
github_token: ${{ github.token }} | |
###### | |
## Build package and publish it to GitHub packages | |
###### | |
- run: npm ci | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |