[mike@mwxm4]
This commit is contained in:
+15
-11
@@ -1,5 +1,9 @@
|
||||
#!/bin/bash
|
||||
# Script to sign and notarize goca Darwin binaries
|
||||
# Script to sign and notarize goca Darwin binaries.
|
||||
#
|
||||
# Runs after ./build.sh and before the release is uploaded: it signs the files
|
||||
# in ./bin in place, so what goes into the Gitea release — and thus what
|
||||
# --update hands out — is the signed and notarized binary.
|
||||
|
||||
set -e
|
||||
|
||||
@@ -21,30 +25,30 @@ fi
|
||||
SIGNING_IDENTITY="Developer ID Application: Mike Wesemann ($TEAM_ID)"
|
||||
|
||||
# Verify binaries exist
|
||||
if [ ! -f "dist/goca-darwin-amd64" ] || [ ! -f "dist/goca-darwin-arm64" ]; then
|
||||
echo "❌ Error: Darwin binaries not found in 'dist/'. Run ./build_releases.sh first."
|
||||
if [ ! -f "bin/goca-darwin-amd64" ] || [ ! -f "bin/goca-darwin-arm64" ]; then
|
||||
echo "❌ Error: Darwin binaries not found in 'bin/'. Run ./build.sh first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "🔐 Step 1: Codesigning Darwin binaries..."
|
||||
codesign --force --options runtime --timestamp --sign "$SIGNING_IDENTITY" dist/goca-darwin-amd64
|
||||
codesign --force --options runtime --timestamp --sign "$SIGNING_IDENTITY" dist/goca-darwin-arm64
|
||||
codesign --force --options runtime --timestamp --sign "$SIGNING_IDENTITY" bin/goca-darwin-amd64
|
||||
codesign --force --options runtime --timestamp --sign "$SIGNING_IDENTITY" bin/goca-darwin-arm64
|
||||
|
||||
echo "📦 Step 2: Packaging binaries into ZIP archives..."
|
||||
mkdir -p dist/notarize
|
||||
rm -f dist/notarize/*.zip
|
||||
ditto -c -k --keepParent dist/goca-darwin-amd64 dist/notarize/goca-darwin-amd64.zip
|
||||
ditto -c -k --keepParent dist/goca-darwin-arm64 dist/notarize/goca-darwin-arm64.zip
|
||||
mkdir -p bin/notarize
|
||||
rm -f bin/notarize/*.zip
|
||||
ditto -c -k --keepParent bin/goca-darwin-amd64 bin/notarize/goca-darwin-amd64.zip
|
||||
ditto -c -k --keepParent bin/goca-darwin-arm64 bin/notarize/goca-darwin-arm64.zip
|
||||
|
||||
echo "🚀 Step 3: Submitting macOS Intel binary (amd64) to Apple Notarization..."
|
||||
xcrun notarytool submit dist/notarize/goca-darwin-amd64.zip \
|
||||
xcrun notarytool submit bin/notarize/goca-darwin-amd64.zip \
|
||||
--apple-id "$APPLE_ID" \
|
||||
--password "$APPLE_PASSWORD" \
|
||||
--team-id "$TEAM_ID" \
|
||||
--wait
|
||||
|
||||
echo "🚀 Step 4: Submitting macOS Apple Silicon binary (arm64) to Apple Notarization..."
|
||||
xcrun notarytool submit dist/notarize/goca-darwin-arm64.zip \
|
||||
xcrun notarytool submit bin/notarize/goca-darwin-arm64.zip \
|
||||
--apple-id "$APPLE_ID" \
|
||||
--password "$APPLE_PASSWORD" \
|
||||
--team-id "$TEAM_ID" \
|
||||
|
||||
Reference in New Issue
Block a user