]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
build: add release script
authorEduardo San Martin Morote <posva13@gmail.com>
Wed, 26 Feb 2020 17:12:46 +0000 (18:12 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Wed, 26 Feb 2020 17:12:46 +0000 (18:12 +0100)
package.json
scripts/release.sh [new file with mode: 0644]

index 101c6b312db468232f965bacb43aa6d053898377..fc8db69810c989cc9b238b02edca14fc7f545bfa 100644 (file)
@@ -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 (file)
index 0000000..06a2253
--- /dev/null
@@ -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