Skip to content

Commit 194b9f8

Browse files
committed
build: github release configuration
1 parent 3391b24 commit 194b9f8

File tree

4 files changed

+340
-18
lines changed

4 files changed

+340
-18
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ example/**/*.js
66
example/**/*.map
77
.idea/
88
dist/
9-
!example/*.js
9+
!example/*.js
10+
publish_release_github\.js

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"yarn": "yarn",
88
"build": "yarn run rimraf dist && yarn run rimraf doc && yarn run build-lib && yarn run build-doc",
99
"build-lib": "ng-packagr -p ng-package.json",
10-
"build-doc": "typedoc --module system --out ./docs ./src/objects"
10+
"build-doc": "typedoc --module system --out ./docs ./src/objects",
11+
"github:release" : "yarn run bestzip build.zip ./dist/* && node publish_release_github.js"
1112
},
1213
"license": "MIT",
1314
"repository": {
@@ -39,6 +40,8 @@
3940
"postcss-discard-comments" : "^2.0.4",
4041
"typedoc": "^0.9.0",
4142
"tslib": "^1.9.0",
42-
"ngx-odata-v4": "^0.0.4"
43+
"ngx-odata-v4": "*",
44+
"bestzip" : "^1.1.4",
45+
"publish-release" : "^1.4.0"
4346
}
4447
}

publish_release_github.draft.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
var publishRelease = require('publish-release')
2+
var pjson = require('./package.json');
3+
4+
publishRelease({
5+
token: '<apiToken>',
6+
owner: 'skynet2',
7+
draft: false,
8+
repo : 'ngx-odata',
9+
name: pjson.name + ' ' + pjson.version,
10+
tag : pjson.version,
11+
prerelease: false,
12+
reuseRelease: true,
13+
reuseDraftOnly: true,
14+
skipAssetsCheck: false,
15+
skipDuplicatedAssets: false,
16+
assets: ['build.zip'],
17+
target_commitish: 'master'
18+
}, function (err, release) {
19+
console.log(err);
20+
// `release`: object returned from github about the newly created release
21+
});

0 commit comments

Comments
 (0)