File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " painterro" ,
3
- "version" : " 0.2.8 " ,
3
+ "version" : " 0.2.9 " ,
4
4
"description" : " Embуedded html image editor" ,
5
5
"main" : " build/painterro.commonjs2.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ # Auto-release script for https://github.com/ivictbor/painterro
4
+ # Creates new release, builds assets and performs publish to github and npm
5
+
6
+ GH_USER=ivictbor
7
+ GH_PATH=` cat ~ /.ghpass`
8
+ GH_REPO=painterro
9
+ GH_TARGET=master
10
+ ASSETS_PATH=build
1
11
npm run build
2
12
npm --no-git-tag-version version patch
3
13
VERSION=` grep ' "version":' package.json | cut -d\" -f4`
4
14
git add -u
5
15
git commit -m " $VERSION "
6
16
git push
7
17
npm publish
18
+
19
+ res=` curl --user " $GH_USER :$GH_PATH " -X POST https://api.github.com/repos/${GH_USER} /${GH_REPO} /releases \
20
+ -d "
21
+ {
22
+ \" tag_name\" : \" v$VERSION \" ,
23
+ \" target_commitish\" : \" $GH_TARGET \" ,
24
+ \" name\" : \" v$VERSION \" ,
25
+ \" body\" : \" new version $VERSION \" ,
26
+ \" draft\" : false,
27
+ \" prerelease\" : false
28
+ }" `
29
+ echo Create release result: ${res}
30
+ rel_id=` echo ${res} | grep -oP ' "id": +\d+' | grep -oP ' \d+' `
31
+ file_name=painterro-${VERSION} .min.js
32
+
33
+ curl --user " $GH_USER :$GH_PATH " -X POST https://uploads.github.com/repos/${GH_USER} /${GH_REPO} /releases/${rel_id} /assets? name=${file_name} \
34
+ --header ' Content-Type: text/javascript ' --upload-file ${ASSETS_PATH} /${file_name}
35
+
36
+ file_map_name=painterro-${VERSION} .min.js.map
37
+ curl --user " $GH_USER :$GH_PATH " -X POST https://uploads.github.com/repos/${GH_USER} /${GH_REPO} /releases/${rel_id} /assets? name=${file_name} \
38
+ --header ' Content-Type: text/javascript ' --upload-file ${ASSETS_PATH} /${file_map_name}
39
+
40
+ rm ${ASSETS_PATH} /${file_name}
41
+ rm ${ASSETS_PATH} /${file_map_name}
You can’t perform that action at this time.
0 commit comments