v0.0.1 #1
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: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
environment: publishing | |
permissions: | |
# contents: write is necessary to allow uploading release artifacts. | |
contents: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Check if on a tag | |
run: if test "x$(git tag --points-at)" = "x" ; then exit 1 ; fi | |
- run: npm install -g npm | |
- run: npm ci | |
# See https://docs.github.com/en/actions/using-workflows/using-github-cli-in-workflows | |
- name: Upload to GitHub | |
run: gh release upload "$(git tag --points-at)" ./publish/*.jpl | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish | |
run: npm publish --provenance --access=public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |