Release & publish to NPM Registry #9
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
## | |
## Release | |
## | |
## This workflows aims to prepare the package for release to GitHub Package Registry. | |
## This can only be triggered manually via GitHub CLI/web. | |
## | |
## The whole process must take at most 3 minutes. | |
## | |
name: 'Release & publish to NPM Registry' | |
on: | |
## Allow triggering this workflow manually via GitHub CLI/web | |
workflow_dispatch: | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
timeout-minutes: 3 | |
permissions: | |
contents: read | |
steps: | |
########################################################################## | |
######################### Prepare the environment ######################## | |
########################################################################## | |
- name: 'Checkout the repository' | |
uses: actions/checkout@v3 | |
- name: 'Use node20' | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.x' | |
cache: 'npm' | |
- run: 'npm ci --ignore-scripts' | |
########################################################################## | |
- name: 'Build the project' | |
run: 'npm run build' | |
- name: 'Publish the lib' | |
run: 'npm run release' | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |