fixup! Automate package publication to npm #3
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 npm | |
on: | |
release: | |
types: | |
- published | |
push: | |
jobs: | |
publish-package-to-npm: | |
name: npm package | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 1 | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 # https://github.com/actions/checkout | |
- name: Prepare Node.js, npm, and Yarn | |
uses: ./.github/actions/node-prepare | |
with: | |
registry-url: https://registry.npmjs.org | |
- name: Generate build artifacts | |
run: yarn run build | |
- name: Optimise package.json for publishing | |
run: npm pkg delete "scripts" "simple-git-hooks" "devDependencies" "packageManager" "//" | |
- name: Generate a package tarball | |
run: yarn pack --out package.tgz | |
- name: Publish the package to npm | |
run: npm publish package.tgz --provenance --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.BOT_NIMBUS_NPM_TOKEN }} |