From: Eduardo San Martin Morote Date: Wed, 26 Feb 2020 17:12:46 +0000 (+0100) Subject: build: add release script X-Git-Tag: v4.0.0-alpha.2~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2541b98a805e79828a295dfe1fa1670fde2cec7d;p=thirdparty%2Fvuejs%2Frouter.git build: add release script --- diff --git a/package.json b/package.json index 101c6b31..fc8db698 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "scripts": { "build": "yarn rollup -c rollup.config.js", "dev": "webpack-dev-server --mode=development", + "release": "bash scripts/release.sh", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 2", "build:playground": "webpack --env.prod", "dev:examples": "webpack-dev-server --mode=development --config examples/webpack.config.js", diff --git a/scripts/release.sh b/scripts/release.sh new file mode 100644 index 00000000..06a22535 --- /dev/null +++ b/scripts/release.sh @@ -0,0 +1,27 @@ +set -e +echo "Enter alpha version e.g., 2 will generate 4.0.0-alpha.2: " +read ALPHA + +VERSION="4.0.0-alpha.$ALPHA" + +read -p "Releasing v$VERSION - are you sure? (y/n)" -n 1 -r +echo # (optional) move to a new line +if [[ $REPLY =~ ^[Yy]$ ]] +then + echo "Releasing v$VERSION ..." + npm test + + # commit + yarn publish --tag next --new-version $VERSION + + # changelog + yarn run changelog + echo "Please check the git history and the changelog and press enter" + read OKAY + git add CHANGELOG.md + git commit -m "chore(changelog): $VERSION" + + # publish + git push origin refs/tags/v$VERSION + git push +fi