forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: enhance bump script to default to a minor version bump (aws#4389)
* chore: enhance bump script to default to a minor version bump Also supports any semVer string as input for scenarios where we want to release patches, major versions, etc. Made a switch to use standard-version to create a commit at the end of the bump. standard-version also takes care of the CHANGELOG generation now. * use npx to execute standard-version
- Loading branch information
1 parent
540f9b2
commit 11d18e0
Showing
3 changed files
with
283 additions
and
15 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,30 +1,34 @@ | ||
#!/bin/bash | ||
# -------------------------------------------------------------------------------------------------- | ||
# | ||
# This script is intended to be used to bump the version of the CDK modules, update package.json, | ||
# package-lock.json, and create a commit. | ||
# | ||
# to start a version bump, run: | ||
# bump.sh <version | version Type> | ||
# | ||
# If a version is not provided, the 'minor' version will be bumped. | ||
# The version can be an explicit version _or_ one of: | ||
# 'major', 'minor', 'patch', 'premajor', 'preminor', 'prepatch', or 'prerelease'. | ||
# | ||
# -------------------------------------------------------------------------------------------------- | ||
set -euo pipefail | ||
ver=${1:-} | ||
if [ -z "${ver}" ]; then | ||
echo "usage: ./bump.sh <version>" | ||
exit 1 | ||
fi | ||
version=${1:-minor} | ||
|
||
echo "Starting ${version} version bump" | ||
|
||
export NODE_OPTIONS="--max-old-space-size=4096 ${NODE_OPTIONS:-}" | ||
|
||
/bin/bash ./install.sh | ||
|
||
npx lerna version --force-publish=* --no-git-tag-version --no-push ${ver} | ||
|
||
# Update CHANGELOG.md only at the root | ||
cat > /tmp/context.json <<HERE | ||
{ | ||
"version": "${ver}" | ||
} | ||
HERE | ||
npx lerna version ${version} --force-publish=* --no-git-tag-version --no-push | ||
|
||
# Another round of install to fix package-lock.jsons | ||
/bin/bash ./install.sh | ||
|
||
./node_modules/.bin/conventional-changelog -p angular -i CHANGELOG.md -s --context /tmp/context.json | ||
|
||
# align "peerDependencies" to actual dependencies after bump | ||
# this is technically only required for major version bumps, but in the meantime we shall do it in every bump | ||
/bin/bash scripts/fix-peer-deps.sh | ||
|
||
# Generate CHANGELOG and create a commit | ||
npx standard-version --release --skip.tag=true --commit-all |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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