Skip to content

Commit cb9895a

Browse files
committed
0.2.9
1 parent b3bd96f commit cb9895a

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "painterro",
3-
"version": "0.2.8",
3+
"version": "0.2.9",
44
"description": "Embуedded html image editor",
55
"main": "build/painterro.commonjs2.js",
66
"scripts": {

publish.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,41 @@
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
111
npm run build
212
npm --no-git-tag-version version patch
313
VERSION=`grep '"version":' package.json | cut -d\" -f4`
414
git add -u
515
git commit -m "$VERSION"
616
git push
717
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}

0 commit comments

Comments
 (0)