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 58cd5b2
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,27 @@ jobs:
with:
node-version: 12
registry-url: https://registry.npmjs.org/

- run:
name: Install jq
command: |
sudo apt update
sudo apt install jq -y
- run:
name: Set package.json version
command: |
git config --local user.email "[email protected]"
git config --local user.name "Melvin Vermeer [ci]"
jq --arg version ${GITHUB_REF#refs/tags/} '.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 ${GITHUB_REF#refs/tags/} [skip ci]"
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

- run:
name: Pushing git changes
command: git push --no-verify

0 comments on commit 58cd5b2

Please sign in to comment.