forked from laverdet/screeps-steamless-client
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update release script to only commit version changes and nothi…
…ng else
- Loading branch information
Showing
1 changed file
with
23 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# Get the current version from package.json | ||
currentVersion=$(node -p "require('./package.json').version") | ||
|
||
# Run semantic-release | ||
npx semantic-release | ||
|
||
# Get the new version from package.json | ||
newVersion=$(node -p "require('./package.json').version") | ||
|
||
# Revert package.json to its state in the Git repository | ||
git checkout HEAD -- package.json | ||
|
||
# If the version has changed, update the version in package.json | ||
if [[ "$currentVersion" != "$newVersion" ]]; then | ||
git config --local user.email "action@github.com" | ||
git config --local user.name "GitHub Action" | ||
npm version --no-git-tag-version $newVersion | ||
git add package.json | ||
git commit -m "chore: release $newVersion [skip ci]" | ||
git push | ||
fi |