npm-publish #49
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
# This workflow will run tests using node and then publish a package to NPM when a release is created | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages | |
name: npm-publish | |
on: workflow_dispatch | |
concurrency: | |
group: build-test-publish | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@master | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.PAT }} | |
- name: Set Node.js 20.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install Dependencies | |
run: yarn install | |
- name: Build | |
run: yarn build | |
- name: Run tests | |
run: yarn test | |
- name: Upgrade version based on Changeset | |
run: yarn changeset version && yarn install | |
env: | |
YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Increase packages version | |
- name: Publish to npm | |
uses: changesets/action@v1 | |
with: | |
publish: yarn release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |