Skip to content

Commit

Permalink
auto update package version on release
Browse files Browse the repository at this point in the history
  • Loading branch information
MelvinVermeer committed Apr 19, 2021
1 parent 3bce5b1 commit 979edb1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,26 @@ jobs:
with:
node-version: 12
registry-url: https://registry.npmjs.org/

- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- run: |
sudo apt update
sudo apt install jq -y
- run: |
git config --local user.email "[email protected]"
git config --local user.name "Melvin Vermeer [ci]"
git fetch
git checkout main
jq --arg version ${{ env.RELEASE_VERSION }} '.version = $version' package.json > package.json.tmp
mv package.json.tmp package.json
git add package.json
git commit --no-verify -m "update package version ${{ env.RELEASE_VERSION }} [skip ci]"
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

- run: git push origin main --no-verify

0 comments on commit 979edb1

Please sign in to comment.