Publish to NPM #22
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 to NPM | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build release package | |
run: npm run release | |
- name: Get package version | |
id: get_version | |
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./dist/nhsapp-frontend-${{ steps.get_version.outputs.VERSION }}.zip | |
asset_name: nhsapp-frontend-${{ steps.get_version.outputs.VERSION }}.zip | |
asset_content_type: application/zip | |
- name: Publish NPM package | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}} | |
IS_PRERELEASE: ${{github.event.release.prerelease}} |