v1.3.0 #29
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: | |
release: | |
types: [published] | |
env: | |
GIT_TERMINAL_PROMPT: 1 | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '16.14.2' | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm install | |
- run: | | |
initialTag=${{ github.event.release.tag_name }} | |
tag="${initialTag//[v]/}" | |
echo $tag | |
git remote update | |
git fetch | |
git checkout --track origin/main | |
git config --global user.email "github-actions@github.com" | |
git config --global user.name "Github Actions" | |
npm --no-git-tag-version --allow-same-version version $tag | |
npm i -g auto-changelog | |
auto-changelog --hide-credit -l 100 | |
git add . | |
git commit -m "release $tag" | |
git push | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |