From 20df5f3844a0874a9978826d3e0e5f4903576fd2 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Mon, 9 Oct 2017 17:46:12 -0700 Subject: [ios, build] Use github-release to check if release has been published --- platform/ios/scripts/deploy-packages.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/platform/ios/scripts/deploy-packages.sh b/platform/ios/scripts/deploy-packages.sh index bdc946497d..103e53768c 100755 --- a/platform/ios/scripts/deploy-packages.sh +++ b/platform/ios/scripts/deploy-packages.sh @@ -58,17 +58,17 @@ BINARY_DIRECTORY=${BINARY_DIRECTORY:-build/ios/deploy} GITHUB_RELEASE=${GITHUB_RELEASE:-true} PUBLISH_PRE_FLAG='' +if [[ -z `which github-release` ]]; then + step "Installing github-release…" + brew install github-release + if [ -z `which github-release` ]; then + echo "Unable to install github-release. See: https://github.com/aktau/github-release" + exit 1 + fi +fi + if [[ ${GITHUB_RELEASE} = "true" ]]; then GITHUB_RELEASE=true # Assign bool, not just a string - - if [[ -z `which github-release` ]]; then - step "Installing github-release…" - brew install github-release - if [ -z `which github-release` ]; then - echo "Unable to install github-release. See: https://github.com/aktau/github-release" - exit 1 - fi - fi fi if [[ -z ${VERSION_TAG} ]]; then @@ -83,7 +83,7 @@ if [[ $( echo ${VERSION_TAG} | grep --invert-match ios-v ) ]]; then exit 1 fi -if [[ $( curl --head https://api.github.com/repos/${GITHUB_USER}/${GITHUB_REPO}/releases/tags/${VERSION_TAG} | head -n 1 | grep -c "404 Not Found") == 0 ]]; then +if github-release info --tag ${VERSION_TAG} | grep --quiet "draft: ✗"; then echo "Error: ${VERSION_TAG} has already been published on GitHub" echo "See: https://github.com/${GITHUB_USER}/${GITHUB_REPO}/releases/tag/${VERSION_TAG}" exit 1 -- cgit v1.2.1