From cb9895a58fe336c0bd63d060f40aba3ca6f1b545 Mon Sep 17 00:00:00 2001 From: ivictbor Date: Sun, 9 Jul 2017 20:34:21 +0300 Subject: [PATCH] 0.2.9 --- package.json | 2 +- publish.sh | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 0a36081..337d2dc 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/publish.sh b/publish.sh index 8b899ee..4c382f0 100644 --- a/publish.sh +++ b/publish.sh @@ -1,3 +1,13 @@ +#!/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` @@ -5,3 +15,27 @@ 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} \ No newline at end of file