Update publish.yml #2
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 NPM Package | ||
on: | ||
push: | ||
branches: main | ||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20" | ||
- name: Bump package version | ||
run: | | ||
git config --global user.email "${{github.actor}}@users.noreply.github.com" | ||
git config --global user.name "${{github.actor}}" | ||
npm version patch | ||
- name: Push updated package + tag to GitHub | ||
run: git push -f && git push --tags -f | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PUSH_GITHUB_TOKEN }} | ||
- name: Publish package to NPM | ||
uses: JS-DevTools/npm-publish@v3 | ||
with: | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||