diff --git a/release-as-zip.sh b/release-as-zip.sh index ea2860e..bbd94ae 100755 --- a/release-as-zip.sh +++ b/release-as-zip.sh @@ -2,23 +2,41 @@ set -e -rm -rf lib - BRANCH_NAME='latest' +set +e +git branch -D ${BRANCH_NAME} +set -e + +rm -rf lib +rm -rf node_modules + npm version patch +git branch ${BRANCH_NAME} git checkout ${BRANCH_NAME} -git merge master +npm install grunt build +rm -rf node_modules +npm install --production git add -f lib/ -libs=$(cat package.json | jq -r '.dependencies' | grep ':' | cut -d: -f1 | tr -d " " | tr -d '"') -for lib in $libs; do - git add -f node_modules/$lib -done +git add -f node_modules/ git commit -m "Update generated code and runtime dependencies." -git push origin ${BRANCH_NAME} +git push --force origin ${BRANCH_NAME} git checkout master + +VERSION=$(cat package.json | jq --raw-output .version) +git push origin "v${VERSION}" npm version patch -git push origin master +npm install + +if [ -e tmp ]; then + rm -rf tmp +fi +mkdir tmp +cd tmp +curl -L https://github.com/sphereio/sphere-product-mapper/archive/latest.zip -o latest.zip +unzip latest.zip +cd sphere-product-mapper-latest/ +node lib/run