Skip to content

Commit 4f2719a

Browse files
authored
feat: build completely without human!
1 parent 02a2e23 commit 4f2719a

File tree

9 files changed

+12419
-72
lines changed

9 files changed

+12419
-72
lines changed

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ node_js:
66
- lts/*
77
git:
88
depth: 3
9+
install:
10+
- yarn --frozen-lockfile
11+
script:
12+
- ./build.sh
13+
after_success:
14+
- GREN_GITHUB_TOKEN=$GITHUB_TOKEN yarn release
15+
cache: yarn
916
deploy:
1017
on:
1118
branch: master

build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
yarn stdver
3+
4+
yarn test
5+
6+
git remote add github https://$GITHUB_TOKEN@github.com/FEMessage/vue-sfc-cli.git > /dev/null 2>&1
7+
git push github HEAD:master --follow-tags
8+

init.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const FileActions = require('./lib/fileActions')
55
const kleur = require('kleur')
66
const path = require('path')
77
const readline = require('readline-sync')
8+
const fs = require('fs')
89

910
const argv = process.argv.slice(2)
1011

@@ -36,4 +37,6 @@ fileActions.move({
3637
}
3738
})
3839

40+
fs.chmodSync(path.join(outDir, 'build.sh'), '755')
41+
3942
logger.success(`Generated into ${kleur.underline(outDir)}`)

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
],
2323
"scripts": {
2424
"test": "echo \"Info: no test specified\"",
25-
"preview": "node init --test && cd v-test && yarn --registry=https://registry.npm.taobao.org && yarn doc"
25+
"preview": "node init --test && cd v-test && yarn --registry=https://registry.npm.taobao.org && yarn doc",
26+
"stdver": "standard-version -m '[skip ci] chore(release): v%s'",
27+
"release": "gren release --override"
2628
},
2729
"dependencies": {
2830
"fs-extra": "^7.0.1",
@@ -32,5 +34,9 @@
3234
},
3335
"engines": {
3436
"npm": ">=5.2.0"
37+
},
38+
"devDependencies": {
39+
"github-release-notes": "^0.17.0",
40+
"standard-version": "^6.0.1"
3541
}
3642
}

templates/.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ git:
99
install:
1010
- yarn --frozen-lockfile
1111
script:
12-
- yarn build
12+
- ./build.sh
13+
after_success:
14+
- GREN_GITHUB_TOKEN=$GITHUB_TOKEN yarn release
1315
cache: yarn
1416
deploy:
1517
- provider: pages

templates/build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
yarn stdver
3+
4+
yarn build
5+
6+
git remote add github https://$GITHUB_TOKEN@github.com/FEMessage/{{componentName}}.git > /dev/null 2>&1
7+
git push github HEAD:master --follow-tags
8+

templates/package-json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
"rollup --config build/rollup.config.js --format es --file dist/{{componentName}}.esm.js",
3030
"build:unpkg":
3131
"rollup --config build/rollup.config.js --format iife --file dist/{{componentName}}.min.js",
32-
"precommit": "pretty-quick --staged"
32+
"precommit": "pretty-quick --staged",
33+
"stdver": "standard-version -m '[skip ci] chore(release): v%s'",
34+
"release": "gren release --override"
3335
},
3436

3537
"dependencies": {},
@@ -39,6 +41,7 @@
3941
"@babel/plugin-transform-runtime": "^7.4.3",
4042
"@babel/preset-env": "^7.4.3",
4143
"babel-loader": "^8.0.5",
44+
"github-release-notes": "^0.17.0",
4245
"glob": "^7.1.3",
4346
"husky": "^0.14.3",
4447
"minimist": "^1.2.0",
@@ -49,6 +52,7 @@
4952
"rollup-plugin-commonjs": "^9.3.4",
5053
"rollup-plugin-terser": "^4.0.4",
5154
"rollup-plugin-vue": "^4.7.2",
55+
"standard-version": "^6.0.1",
5256
"stylus": "^0.54.5",
5357
"stylus-loader": "^3.0.2",
5458
"vue": "^2.5.16",

0 commit comments

Comments
 (0)