Skip to content

Commit e9aa6f9

Browse files
committed
build: add release script and CHANGELOG
1 parent a60e64c commit e9aa6f9

File tree

5 files changed

+420
-12
lines changed

5 files changed

+420
-12
lines changed

CHANGELOG

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<a name="0.1.0"></a>
2+
# 0.1.0 (2017-09-02)
3+
4+
5+
### Bug Fixes
6+
7+
* add correct main file ([a60e64c](https://github.com/eddyerburgh/vue-jest/commit/a60e64c))
8+
9+
10+
### Features
11+
12+
* **typescript:** add ts support ([4354570](https://github.com/eddyerburgh/vue-jest/commit/4354570))

build/gen-release-note.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const version = process.argv[2] || process.env.VERSION
2+
const cc = require('conventional-changelog')
3+
const file = `./RELEASE_NOTE${version ? `_${version}` : ``}.md`
4+
const fileStream = require('fs').createWriteStream(file)
5+
6+
cc({
7+
preset: 'angular',
8+
pkg: {
9+
transform (pkg) {
10+
pkg.version = `v${version}`
11+
return pkg
12+
}
13+
}
14+
}).pipe(fileStream).on('close', () => {
15+
console.log(`Generated release note at ${file}`)
16+
})

build/release.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
# run tests
12+
npm test 2>/dev/null
13+
14+
# build
15+
VERSION=$VERSION npm run build
16+
17+
# commit
18+
git add -A
19+
git commit -m "[build] $VERSION"
20+
npm version $VERSION --message "[release] $VERSION"
21+
22+
# publish
23+
git push origin refs/tags/v$VERSION
24+
git push
25+
npm publish
26+
fi

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"scripts": {
77
"lint": "eslint jest-vue.js test",
88
"lint:fix": "npm run lint -- --fix",
9+
"release:note": "node build/gen-release-note.js",
910
"test": "npm run lint && npm run unit",
1011
"unit": "cross-env BABEL_ENV=test jest --no-cache --coverage --coverageDirectory test/coverage"
1112
},
@@ -17,6 +18,7 @@
1718
"babel-plugin-transform-runtime": "^6.23.0",
1819
"babel-preset-env": "^1.6.0",
1920
"babel-preset-es2015": "^6.24.1",
21+
"conventional-changelog": "^1.1.5",
2022
"cross-env": "^5.0.2",
2123
"eslint": "^4.3.0",
2224
"eslint-plugin-html": "^3.1.1",

0 commit comments

Comments
 (0)