Skip to content

Commit

Permalink
0.2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
ivictbor committed Jul 9, 2017
1 parent b3bd96f commit cb9895a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "painterro",
"version": "0.2.8",
"version": "0.2.9",
"description": "Embуedded html image editor",
"main": "build/painterro.commonjs2.js",
"scripts": {
Expand Down
34 changes: 34 additions & 0 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,41 @@
#!/usr/bin/env bash

# Auto-release script for https://github.com/ivictbor/painterro
# Creates new release, builds assets and performs publish to github and npm

GH_USER=ivictbor
GH_PATH=`cat ~/.ghpass`
GH_REPO=painterro
GH_TARGET=master
ASSETS_PATH=build
npm run build
npm --no-git-tag-version version patch
VERSION=`grep '"version":' package.json | cut -d\" -f4`
git add -u
git commit -m "$VERSION"
git push
npm publish

res=`curl --user "$GH_USER:$GH_PATH" -X POST https://api.github.com/repos/${GH_USER}/${GH_REPO}/releases \
-d "
{
\"tag_name\": \"v$VERSION\",
\"target_commitish\": \"$GH_TARGET\",
\"name\": \"v$VERSION\",
\"body\": \"new version $VERSION\",
\"draft\": false,
\"prerelease\": false
}"`
echo Create release result: ${res}
rel_id=`echo ${res}| grep -oP '"id": +\d+' | grep -oP '\d+'`
file_name=painterro-${VERSION}.min.js

curl --user "$GH_USER:$GH_PATH" -X POST https://uploads.github.com/repos/${GH_USER}/${GH_REPO}/releases/${rel_id}/assets?name=${file_name}\
--header 'Content-Type: text/javascript ' --upload-file ${ASSETS_PATH}/${file_name}

file_map_name=painterro-${VERSION}.min.js.map
curl --user "$GH_USER:$GH_PATH" -X POST https://uploads.github.com/repos/${GH_USER}/${GH_REPO}/releases/${rel_id}/assets?name=${file_name}\
--header 'Content-Type: text/javascript ' --upload-file ${ASSETS_PATH}/${file_map_name}

rm ${ASSETS_PATH}/${file_name}
rm ${ASSETS_PATH}/${file_map_name}

0 comments on commit cb9895a

Please sign in to comment.