From f332a3db847e8ca062dc2422d479a905a146369f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Thu, 31 May 2018 16:45:45 +0200 Subject: [PATCH] add scripts/release.sh --- package.json | 2 +- scripts/release.sh | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100755 scripts/release.sh diff --git a/package.json b/package.json index 892439a8c2..378e490a7f 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "postinstall": "bash ./scripts/postinstall.sh", "prettier": "prettier --write \"{src,webpack,.storybook}/**/*.js\"", "publish-storybook": "bash ./scripts/publish-storybook.sh", - "release": "yarn compile && build", + "release": "bash ./scripts/release.sh", "start": "bash ./scripts/start.sh", "storybook": "NODE_ENV=development STORYBOOK_ENV=1 start-storybook -s ./static -p 4444", "trans": "node scripts/trans" diff --git a/scripts/release.sh b/scripts/release.sh new file mode 100755 index 0000000000..e147d9c0a3 --- /dev/null +++ b/scripts/release.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +set -e + +if [ -z "$GH_TOKEN" ]; then + echo "GH_TOKEN is unset. can't release" >&2 + exit 1 +fi + +if ! git diff-index --quiet HEAD --; then + echo "you have uncommitted local changes!" >&2 + exit 1 +fi + +export SENTRY_URL=https://db8f5b9b021048d4a401f045371701cb@sentry.io/274561 +yarn compile +build