Publish to NPM Packages #4
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 Packages | |
on: | |
workflow_dispatch: | |
## Uncomment the following lines to trigger the workflow on push | |
# push: | |
# branches: | |
# - main | |
# - next | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # to be able to publish a GitHub release | |
issues: write # to be able to comment on released issues | |
pull-requests: write # to be able to comment on released pull requests | |
id-token: write # to enable use of OIDC for npm provenance | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'yarn' | |
- run: yarn install | |
- run: yarn test | |
- run: yarn build | |
- run: yarn semantic-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |