Publish #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
name: Publish | |
on: | |
release: | |
types: [released, prereleased] | |
workflow_dispatch: | |
jobs: | |
publish-npm: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
registry-url: https://registry.npmjs.org/ | |
- name: Install the latest version of the npm CLI | |
run: npm install -g npm@10 #todo upgrade to the latest | |
- name: Install dependencies, build | |
run: | | |
echo '${{ github.event.action }}' | |
npm ci | |
npm run build | |
- name: Publish 'latest' | |
if: ${{ github.event.action == 'released' }} | |
run: | | |
npm publish --provenance | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish 'next' | |
if: ${{ github.event.action == 'prereleased' }} | |
run: | | |
npm publish --tag next --provenance | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |