Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit 5ab3623

Browse files
committed
chore(release): automated release process
1 parent 1c8b49d commit 5ab3623

File tree

4 files changed

+57
-4
lines changed

4 files changed

+57
-4
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ To get the latest `@ionic/app-scripts`, please run:
44
npm install @ionic/app-scripts@latest --save-dev
55
```
66

7+
# 0.0.39 (2016-10-31)
8+
* Switch default bundler to Webpack
79

810
# 0.0.36 (2016-10-15)
911

README.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,14 @@ Example NPM Script:
157157
- [Autoprefixer](https://github.com/postcss/autoprefixer)
158158
- [UglifyJS](http://lisperator.net/uglifyjs/)
159159
- [CleanCss](https://github.com/jakubpawlowicz/clean-css)
160-
- [TSLint](http://palantir.github.io/tslint/)
160+
- [TSLint](http://palantir.github.io/tslint/)
161+
162+
163+
164+
## Contributing
165+
166+
### Publish a release
167+
168+
Execute the following steps to publish a release:
169+
170+
1. Run `npm run release`

package.json

+11-3
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
"scripts": {
1919
"build": "npm run clean && tsc",
2020
"build-and-test": "npm run build && npm run test",
21-
"conventional-changelog": "./node_modules/.bin/conventional-changelog",
22-
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
21+
"changelog": "./node_modules/.bin/conventional-changelog -p angular -i CHANGELOG.md -s",
2322
"clean": "rimraf ./dist",
23+
"github-release": "node ./scripts/create-github-release.js",
2424
"lint": "tslint -c ./tslint.json --project ./tsconfig.json",
25+
"release": "npm run build && npm run test && npm version patch && npm changelog && npm run github-release && npm publish",
2526
"test": "jasmine JASMINE_CONFIG_PATH=src/spec/jasmine.config.json || true",
2627
"watch": "npm run clean && tsc --watch"
2728
},
@@ -31,7 +32,7 @@
3132
"chalk": "1.1.3",
3233
"chokidar": "1.6.0",
3334
"clean-css": "3.4.19",
34-
"conventional-changelog-cli": "^1.2.0",
35+
"conventional-changelog-cli": "^1.2.0",
3536
"cross-spawn": "4.0.0",
3637
"express": "^4.14.0",
3738
"fs-extra": "0.30.0",
@@ -67,6 +68,8 @@
6768
"@types/uglify-js": "2.0.27",
6869
"@types/webpack": "^1.12.35",
6970
"@types/ws": "0.0.34",
71+
"github": "^0.2.4",
72+
"ionic-cz-conventional-changelog": "^1.0.0",
7073
"jasmine": "2.5.2",
7174
"mock-fs": "^3.11.0",
7275
"rimraf": "^2.5.4",
@@ -79,5 +82,10 @@
7982
},
8083
"bugs": {
8184
"url": "https://github.com/driftyco/ionic-app-scripts/issues"
85+
},
86+
"config": {
87+
"commitizen": {
88+
"path": "node_modules/ionic-cz-conventional-changelog"
89+
}
8290
}
8391
}

scripts/create-github-release.js

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
var path = require('path');
2+
var execSync = require('child_process').execSync;
3+
4+
var GithubApi = require('github');
5+
6+
var changelogCommand = './node_modules/.bin/conventional-changelog -p angular';
7+
8+
var packageJsonPath = path.join(__dirname, '..', 'package.json');
9+
var packageJson = require(packageJsonPath);
10+
11+
var github = new GithubApi({ version: '3.0.0'});
12+
13+
github.authenticate({ type: 'oauth', token: process.env.GH_TOKEN });
14+
15+
var changelogContent = execSync(changelogCommand).toString();
16+
17+
github.releases.createRelease({
18+
owner: 'driftyco',
19+
repo: 'ionic-app-scripts',
20+
target_commitish: 'master',
21+
tag_name: 'v' + packageJson.version,
22+
name: packageJson.version,
23+
body: changelogContent,
24+
prerelease: false
25+
}, function(err, result) {
26+
if (err) {
27+
console.log('[create-github-release] An error occurred: ' + err.message);
28+
process.exit(1);
29+
}
30+
else {
31+
console.log('[create-github-release]: Process succeeded');
32+
}
33+
});

0 commit comments

Comments
 (0)