fix #20
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 GitHub Packages when a release is created | ||
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages | ||
name: Node.js Package | ||
on: | ||
push: | ||
branches: | ||
- main | ||
#paths: | ||
# - package.json | ||
jobs: | ||
npm-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- run: yarn version | ||
- name: Install Dependencies | ||
run: yarn install | ||
- name: Build | ||
run: yarn build | ||
- id: Publish | ||
name: Publish to NPM | ||
uses: JS-DevTools/npm-publish@v3 | ||
strategy: upgrade | ||
with: | ||
token: ${{secrets.NPM_PUBLISH_TOKEN}} | ||
dry-run: false | ||
- name: Post-publish | ||
if: steps.publish.outputs.type != 'none' | ||
run: | | ||
echo "Published ${{ steps.publish.outputs.type }} version: ${{ steps.publish.outputs.version }}" | ||
- name: Publish skipped | ||
if: steps.publish.outputs.type == 'none' | ||
run: | | ||
echo "Version in package.json has not changed. Skipping." | ||
exit 0 |