-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
auto update package version on release
- Loading branch information
1 parent
3bce5b1
commit 979edb1
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |