AUTH-3103 CI build fixes

This commit is contained in:
Dalton 2020-09-17 10:56:18 -05:00 committed by Dalton Cherry
parent 747427f816
commit afa5e68fe5
3 changed files with 15 additions and 17 deletions

View File

@ -1,7 +1,5 @@
#!/bin/bash #!/bin/bash
#set -euo pipefail
if [[ "$(uname)" != "Darwin" ]] ; then if [[ "$(uname)" != "Darwin" ]] ; then
echo "This should be run on macOS" echo "This should be run on macOS"
exit 1 exit 1
@ -31,8 +29,8 @@ cd ../src/github.com/cloudflare/cloudflared
GOCACHE="$PWD/../../../../" GOPATH="$PWD/../../../../" CGO_ENABLED=1 make cloudflared GOCACHE="$PWD/../../../../" GOPATH="$PWD/../../../../" CGO_ENABLED=1 make cloudflared
# Add code signing private key to the key chain # Add code signing private key to the key chain
if [[ -n "${CFD_CODE_SIGN_KEY:-}" ]]; then if [[ ! -z "$CFD_CODE_SIGN_KEY" ]]; then
if [[ -n "${CFD_CODE_SIGN_PASS:-}" ]]; then if [[ ! -z "$CFD_CODE_SIGN_PASS" ]]; then
# write private key to disk and then import it keychain # write private key to disk and then import it keychain
echo -n -e ${CFD_CODE_SIGN_KEY} | base64 -D > ${CODE_SIGN_PRIV} echo -n -e ${CFD_CODE_SIGN_KEY} | base64 -D > ${CODE_SIGN_PRIV}
out=$(security import ${CODE_SIGN_PRIV} -A -P "${CFD_CODE_SIGN_PASS}" 2>&1) out=$(security import ${CODE_SIGN_PRIV} -A -P "${CFD_CODE_SIGN_PASS}" 2>&1)
@ -52,7 +50,7 @@ if [[ -n "${CFD_CODE_SIGN_KEY:-}" ]]; then
fi fi
# Add code signing certificate to the key chain # Add code signing certificate to the key chain
if [[ -n "${CFD_CODE_SIGN_CERT:-}" ]]; then if [[ ! -z "$CFD_CODE_SIGN_CERT" ]]; then
# write certificate to disk and then import it keychain # write certificate to disk and then import it keychain
echo -n -e ${CFD_CODE_SIGN_CERT} | base64 -D > ${CODE_SIGN_CERT} echo -n -e ${CFD_CODE_SIGN_CERT} | base64 -D > ${CODE_SIGN_CERT}
out1=$(security import ${CODE_SIGN_CERT} -A 2>&1) out1=$(security import ${CODE_SIGN_CERT} -A 2>&1)
@ -73,8 +71,8 @@ if [[ -n "${CFD_CODE_SIGN_CERT:-}" ]]; then
fi fi
# Add package signing private key to the key chain # Add package signing private key to the key chain
if [[ -n "${CFD_INSTALLER_KEY:-}" ]]; then if [[ ! -z "$CFD_INSTALLER_KEY" ]]; then
if [[ -n "${CFD_INSTALLER_PASS:-}" ]]; then if [[ ! -z "$CFD_INSTALLER_PASS" ]]; then
# write private key to disk and then import it into the keychain # write private key to disk and then import it into the keychain
echo -n -e ${CFD_INSTALLER_KEY} | base64 -D > ${INSTALLER_PRIV} echo -n -e ${CFD_INSTALLER_KEY} | base64 -D > ${INSTALLER_PRIV}
out2=$(security import ${INSTALLER_PRIV} -A -P "${CFD_INSTALLER_PASS}" 2>&1) out2=$(security import ${INSTALLER_PRIV} -A -P "${CFD_INSTALLER_PASS}" 2>&1)
@ -94,7 +92,7 @@ if [[ -n "${CFD_INSTALLER_KEY:-}" ]]; then
fi fi
# Add package signing certificate to the key chain # Add package signing certificate to the key chain
if [[ -n "${CFD_INSTALLER_CERT:-}" ]]; then if [[ ! -z "$CFD_INSTALLER_CERT" ]]; then
# write certificate to disk and then import it keychain # write certificate to disk and then import it keychain
echo -n -e ${CFD_INSTALLER_CERT} | base64 -D > ${INSTALLER_CERT} echo -n -e ${CFD_INSTALLER_CERT} | base64 -D > ${INSTALLER_CERT}
out3=$(security import ${INSTALLER_CERT} -A 2>&1) out3=$(security import ${INSTALLER_CERT} -A 2>&1)
@ -115,7 +113,7 @@ if [[ -n "${CFD_INSTALLER_CERT:-}" ]]; then
fi fi
# get the code signing certificate name # get the code signing certificate name
if [[ -n "${CFD_CODE_SIGN_NAME:-}" ]]; then if [[ ! -z "$CFD_CODE_SIGN_NAME" ]]; then
CODE_SIGN_NAME="${CFD_CODE_SIGN_NAME}" CODE_SIGN_NAME="${CFD_CODE_SIGN_NAME}"
else else
if [[ -n "$(security find-certificate -c "Developer ID Application" | cut -d'"' -f 4 -s | grep "Developer ID Application:" | head -1)" ]]; then if [[ -n "$(security find-certificate -c "Developer ID Application" | cut -d'"' -f 4 -s | grep "Developer ID Application:" | head -1)" ]]; then
@ -126,7 +124,7 @@ else
fi fi
# get the package signing certificate name # get the package signing certificate name
if [[ -n "${CFD_INSTALLER_NAME:-}" ]]; then if [[ ! -z "$CFD_INSTALLER_NAME" ]]; then
PKG_SIGN_NAME="${CFD_INSTALLER_NAME}" PKG_SIGN_NAME="${CFD_INSTALLER_NAME}"
else else
if [[ -n "$(security find-certificate -c "Developer ID Installer" | cut -d'"' -f 4 -s | grep "Developer ID Installer:" | head -1)" ]]; then if [[ -n "$(security find-certificate -c "Developer ID Installer" | cut -d'"' -f 4 -s | grep "Developer ID Installer:" | head -1)" ]]; then
@ -137,11 +135,11 @@ else
fi fi
# sign the cloudflared binary # sign the cloudflared binary
if [[ -n "${CODE_SIGN_NAME:-}" ]]; then if [[ ! -z "$CODE_SIGN_NAME" ]]; then
codesign -s "${CODE_SIGN_NAME}" -f -v --timestamp --options runtime ${BINARY_NAME} codesign -s "${CODE_SIGN_NAME}" -f -v --timestamp --options runtime ${BINARY_NAME}
# notarize the binary # notarize the binary
if [[ -n "${CFD_NOTE_PASSWORD:-}" ]]; then if [[ ! -z "$CFD_NOTE_PASSWORD" ]]; then
zip "${BINARY_NAME}.zip" ${BINARY_NAME} zip "${BINARY_NAME}.zip" ${BINARY_NAME}
xcrun altool --notarize-app -f "${BINARY_NAME}.zip" -t osx -u ${CFD_NOTE_USERNAME} -p ${CFD_NOTE_PASSWORD} --primary-bundle-id ${BUNDLE_ID} xcrun altool --notarize-app -f "${BINARY_NAME}.zip" -t osx -u ${CFD_NOTE_USERNAME} -p ${CFD_NOTE_PASSWORD} --primary-bundle-id ${BUNDLE_ID}
fi fi
@ -161,7 +159,7 @@ cp ${BINARY_NAME} "${TARGET_DIRECTORY}/contents/${PRODUCT}"
tar czf "$FILENAME" "${BINARY_NAME}" tar czf "$FILENAME" "${BINARY_NAME}"
# build the installer package # build the installer package
if [[ -n "${PKG_SIGN_NAME:-}" ]]; then if [[ ! -z "$PKG_SIGN_NAME" ]]; then
pkgbuild --identifier com.cloudflare.${PRODUCT} \ pkgbuild --identifier com.cloudflare.${PRODUCT} \
--version ${VERSION} \ --version ${VERSION} \
--scripts ${TARGET_DIRECTORY}/scripts \ --scripts ${TARGET_DIRECTORY}/scripts \
@ -171,7 +169,7 @@ if [[ -n "${PKG_SIGN_NAME:-}" ]]; then
${PKGNAME} ${PKGNAME}
# notarize the package # notarize the package
if [[ -n "${CFD_NOTE_PASSWORD:-}" ]]; then if [[ ! -z "$CFD_NOTE_PASSWORD" ]]; then
xcrun altool --notarize-app -f ${PKGNAME} -t osx -u ${CFD_NOTE_USERNAME} -p ${CFD_NOTE_PASSWORD} --primary-bundle-id ${BUNDLE_ID} xcrun altool --notarize-app -f ${PKGNAME} -t osx -u ${CFD_NOTE_USERNAME} -p ${CFD_NOTE_PASSWORD} --primary-bundle-id ${BUNDLE_ID}
xcrun stapler staple ${PKGNAME} xcrun stapler staple ${PKGNAME}
fi fi

View File

@ -148,8 +148,8 @@ github-message:
.PHONY: github-mac-upload .PHONY: github-mac-upload
github-mac-upload: github-mac-upload:
python3 github_release.py --path .artifacts/cloudflared-darwin-amd64.tgz --release-version $(VERSION) --name cloudflared-darwin-amd64.tgz python3 github_release.py --path artifacts/cloudflared-darwin-amd64.tgz --release-version $(VERSION) --name cloudflared-darwin-amd64.tgz
python3 github_release.py --path .artifacts/cloudflared-amd64.pkg --release-version $(VERSION) --name cloudflared-amd64.pkg python3 github_release.py --path artifacts/cloudflared-amd64.pkg --release-version $(VERSION) --name cloudflared-amd64.pkg
bin/equinox: bin/equinox:
mkdir -p bin mkdir -p bin

View File

@ -107,7 +107,7 @@ def main():
return return
# update the release body text # update the release body text
release.update_release(args.release_version, args.release_version, msg) release.update_release(args.release_version, msg)
except Exception as e: except Exception as e:
logging.exception(e) logging.exception(e)