CI - Include tests in publish workflow #12
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: | |
push: | |
tags: ['v*'] | |
workflow_dispatch: | |
jobs: | |
tests-workflow: | |
uses: ./.github/workflows/tests.yml | |
publish: | |
needs: tests-workflow | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '19.x' | |
registry-url: 'https://registry.npmjs.org' | |
- uses: pnpm/action-setup@v2 | |
name: Install pnpm | |
with: | |
version: 8 | |
run_install: true | |
- name: Build Notivue | |
run: pnpm -C packages/notivue run build | |
# Delete any existing tarball, pack a new one, and verify the presence | |
# of all expected files and no debug statements in the code. | |
- name: Pack and verify | |
run: cd packages/notivue && rm -rf *.tgz && npm pack && ./scripts/verify-tarball.sh | |
- name: Publish | |
run: cd packages/notivue && npm publish *.tgz --provenance | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |