Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert: signing cli macos binary #5416

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ workflows:
go_download_base_url: << pipeline.parameters.go_download_base_url >>
executor: macos-arm64
install_deps_extension: macos-build
context: snyk-macos-signing
requires:
- prepare-build

Expand All @@ -497,7 +496,6 @@ workflows:
go_download_base_url: << pipeline.parameters.go_download_base_url >>
executor: macos-arm64
install_deps_extension: macos-build
context: snyk-macos-signing
requires:
- prepare-build

Expand Down
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,10 @@ $(BINARY_RELEASES_FOLDER_TS_CLI)/snyk-linux-arm64: prepack | $(BINARY_RELEASES_F

$(BINARY_RELEASES_FOLDER_TS_CLI)/snyk-macos: prepack | $(BINARY_RELEASES_FOLDER_TS_CLI)
$(PKG) -t node$(PKG_NODE_VERSION)-macos-x64 -o $(BINARY_RELEASES_FOLDER_TS_CLI)/snyk-macos
$(SHELL) $(WORKING_DIR)/cliv2/scripts/sign_darwin.sh $(BINARY_RELEASES_FOLDER_TS_CLI) snyk-macos skip-notarize
$(MAKE) $(BINARY_RELEASES_FOLDER_TS_CLI)/snyk-macos.sha256

$(BINARY_RELEASES_FOLDER_TS_CLI)/snyk-macos-arm64: prepack | $(BINARY_RELEASES_FOLDER_TS_CLI)
$(PKG) -t node$(PKG_NODE_VERSION)-macos-arm64 -o $(BINARY_RELEASES_FOLDER_TS_CLI)/snyk-macos-arm64 --no-bytecode
$(SHELL) $(WORKING_DIR)/cliv2/scripts/sign_darwin.sh $(BINARY_RELEASES_FOLDER_TS_CLI) snyk-macos-arm64 skip-notarize
$(MAKE) $(BINARY_RELEASES_FOLDER_TS_CLI)/snyk-macos-arm64.sha256

$(BINARY_RELEASES_FOLDER_TS_CLI)/snyk-win.exe: prepack | $(BINARY_RELEASES_FOLDER_TS_CLI)
Expand Down
13 changes: 1 addition & 12 deletions cliv2/scripts/sign_darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ set -euo pipefail

EXPORT_PATH=${1:-./bin}
PRODUCT_NAME=${2:-snyk_darwin_amd64}
SKIP_NOTARIZE=${3:-0}
KEYCHAIN_PROFILE=AC_PASSWORD
APP_PATH="$EXPORT_PATH/$PRODUCT_NAME"
ZIP_PATH="$EXPORT_PATH/$PRODUCT_NAME.zip"
Expand All @@ -31,12 +30,6 @@ if [[ "$OSTYPE" != *"darwin"* ]]; then
exit 1
fi

# if the required secrets are not available we skip signing completely without an error to enable local builds on windows. A later issigned check will catch this error in the build pipeline
if [ -z "${APPLE_ID+x}" ]; then
echo "$LOG_PREFIX Skipping signing, since the required secrets are not available."
exit 0
fi

#
# signing
#
Expand All @@ -58,16 +51,12 @@ security set-key-partition-list -S apple-tool:,apple: -s -k "$KEYCHAIN_PASSWORD"
sleep 10

echo "$LOG_PREFIX Signing binary $APP_PATH"
codesign -f -s "$APPLE_SIGNING_IDENTITY" -v "$APP_PATH" --timestamp --options runtime
codesign -s "$APPLE_SIGNING_IDENTITY" -v "$APP_PATH" --timestamp --options runtime

#
# notarization
#

if [[ "$SKIP_NOTARIZE" = "skip-notarize" ]]; then
exit 0
fi

# create a zip file
echo "$LOG_PREFIX Creating zip file $ZIP_PATH"
/usr/bin/ditto -c -k --keepParent "$APP_PATH" "$ZIP_PATH"
Expand Down