Skip to content

Commit 193f307

Browse files
committed
release script
1 parent fbe81fb commit 193f307

File tree

3 files changed

+41
-7
lines changed

3 files changed

+41
-7
lines changed

build/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var banner =
2222
// Update main file
2323
var main = fs
2424
.readFileSync('src/core/index.js', 'utf-8')
25-
.replace(/Vue\.version = '[\d\.]+'/, "Vue.version = '" + version + "'")
25+
.replace(/Vue\.version = '[^']+'/, "Vue.version = '" + version + "'")
2626
fs.writeFileSync('src/core/index.js', main)
2727

2828
var builds = [

build/release.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
set -e
2+
echo "Enter release version: "
3+
read VERSION
4+
5+
read -p "Releasing $VERSION - are you sure? (y/n)" -n 1 -r
6+
echo # (optional) move to a new line
7+
if [[ $REPLY =~ ^[Yy]$ ]]
8+
then
9+
echo "Releasing $VERSION ..."
10+
11+
npm test 2>/dev/null
12+
13+
# build
14+
VERSION=$VERSION npm run build
15+
16+
# update packages
17+
cd packages/vue-template-compiler
18+
npm version $VERSION
19+
npm publish
20+
cd -
21+
22+
cd packages/vue-server-renderer
23+
npm version $VERSION
24+
npm publish
25+
cd -
26+
27+
# commit
28+
git add -A
29+
git commit -m "[build] $VERSION"
30+
npm version $VERSION --message "[release] $VERSION"
31+
32+
# publish
33+
git push origin refs/tags/v$VERSION
34+
git push
35+
npm publish --tag next
36+
fi

package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
{
22
"name": "vue",
3-
"version": "2.0.0-alpha.1",
3+
"version": "2.0.0-alpha.0",
44
"description": "Reactive, component-oriented view layer for modern web interfaces.",
55
"main": "dist/vue.common.js",
66
"files": [
77
"dist/vue.common.js",
88
"dist/vue.js",
99
"dist/vue.min.js",
10-
"dist/compiler.js",
11-
"dist/server-renderer.js",
1210
"src"
1311
],
1412
"scripts": {
1513
"dev": "webpack --watch --config build/webpack.dist.dev.config.js",
1614
"dev:test": "karma start build/karma.dev.config.js",
1715
"dev:ssr": "webpack --watch --config build/webpack.ssr.dev.config.js",
1816
"dev:compiler": "webpack --watch --config build/webpack.compiler.dev.config.js",
19-
"test": "npm run lint && flow check && npm run test:unit && npm run test:e2e && npm run test:ssr",
20-
"ci": "npm run lint && flow check && npm run test:cover && npm run test:ssr",
17+
"test": "npm run lint && flow check && npm run test:cover && npm run test:unit && npm run test:e2e && npm run test:ssr",
2118
"build": "NODE_ENV=production node build/build.js",
2219
"lint": "eslint src build test",
2320
"flow": "flow check",
@@ -26,7 +23,8 @@
2623
"test:e2e": "npm run build -- vue.js && node test/e2e/runner.js",
2724
"build:ssr": "npm run build -- vue.common.js,vue-template-compiler,vue-server-renderer",
2825
"test:ssr": "npm run build:ssr && NODE_ENV=development VUE_ENV=server jasmine JASMINE_CONFIG_PATH=test/ssr/jasmine.json",
29-
"bench:ssr": "npm run build:ssr && NODE_ENV=production VUE_ENV=server node benchmarks/ssr/renderToString.js && NODE_ENV=production VUE_ENV=server node benchmarks/ssr/renderToStream.js"
26+
"bench:ssr": "npm run build:ssr && NODE_ENV=production VUE_ENV=server node benchmarks/ssr/renderToString.js && NODE_ENV=production VUE_ENV=server node benchmarks/ssr/renderToStream.js",
27+
"release": "bash build/release.sh"
3028
},
3129
"repository": {
3230
"type": "git",

0 commit comments

Comments
 (0)