-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
14 additions
and
9 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 |
---|---|---|
@@ -1,16 +1,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [[ ! -d .yarn/versions ]]; then | ||
# Update pach number if no versions to be applied | ||
yarn version patch --deferred | ||
LEVEL=$1 | ||
if [[ -z "$LEVEL" ]]; then | ||
LEVEL="prerelease" | ||
fi | ||
|
||
# Apply all deferred version upgrades | ||
CURRENT_VERSION=$(jq -r .version package.json) | ||
NEXT_VERSION=$(yarn semver ${CURRENT_VERSION} --increment ${LEVEL} --preid alpha) | ||
|
||
# Generate new commit | ||
yarn version --deferred "${NEXT_VERSION}" | ||
yarn version apply --all | ||
|
||
# Update changelog and commit new version | ||
NEW_VERSION="v$(jq -r .version package.json)" | ||
bash sbin/changelog.sh -u ${NEW_VERSION} | ||
echo "<<< Update changelog >>>" | ||
sbin/changelog.sh -u "v${NEXT_VERSION}" | ||
|
||
echo "<<< Commit all changes and tag the new version >>>" | ||
git add -u | ||
git commit -m ${NEW_VERSION} | ||
git tag -a -m ${NEW_VERSION} ${NEW_VERSION} | ||
git commit -m "v$NEXT_VERSION" | ||
git tag -a "v$NEXT_VERSION" -m "v$NEXT_VERSION" |