Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
No hard fail on missing credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
jgustie committed Jul 9, 2020
1 parent 617e52a commit d5eb382
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions hack/notarize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ OUTPUT="${2:?missing output argument}"
# This script MUST produce an output file or fail.
case "$(basename "$FILE")" in
"redskyctl-darwin-amd64.tar.gz")
# Do nothing, just fall through to the notarization bit (the "signature file" will contain the request UUID)
# If there are no credentials, just produce an empty file (otherwise fall through)
if [ -n "${AC_USERNAME:-}" ] || [ -n "${AC_PASSWORD:-}" ] ; then
touch "${OUTPUT}"
exit
fi
;;
"checksums.txt")
# Sign the checksums using GPG (mimic the default GoReleaser behavior)
Expand All @@ -29,8 +33,6 @@ esac
command -v ditto >/dev/null 2>&1 || { echo >&2 "notarization failed, ditto not present"; exit 1; }
command -v xcrun >/dev/null 2>&1 || { echo >&2 "notarization failed, xcrun not present"; exit 1; }
command -v jq >/dev/null 2>&1 || { echo >&2 "notarization failed, jq not present"; exit 1; }
[ -n "${AC_USERNAME:-}" ] || { echo >&2 "notarization failed, no credentials"; exit 1; }
[ -n "${AC_PASSWORD:-}" ] || { echo >&2 "notarization failed, no credentials"; exit 1; }

# Create a temporary location to perform notarization
NAME="$(basename "$FILE" ".tar.gz")"
Expand Down

0 comments on commit d5eb382

Please # to comment.