4545 name : Build Binaries for ${{ matrix.target }}
4646 needs : validate_version
4747 runs-on : ${{ matrix.os }}
48- env :
49- APPLE_SIGNING_ENABLED : ${{ secrets.APPLE_CERTIFICATE_BASE64 != '' }}
50- APPLE_NOTARIZATION_ENABLED : ${{ secrets.APPLE_API_KEY_BASE64 != '' }}
5148 strategy :
5249 matrix :
5350 include :
@@ -104,11 +101,25 @@ jobs:
104101 fi
105102
106103 - name : Import Apple Certificate (macOS only)
107- if : ( matrix.os == 'macos-latest' || matrix.os == 'macos-14') && env.APPLE_SIGNING_ENABLED == 'true '
104+ if : matrix.os == 'macos-latest' || matrix.os == 'macos-14'
108105 env :
109106 APPLE_CERTIFICATE_BASE64 : ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
110107 APPLE_CERTIFICATE_PASSWORD : ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
111108 run : |
109+ # Debug: Check if secrets are set (without revealing them)
110+ echo "=== Checking secrets ==="
111+ if [ -z "$APPLE_CERTIFICATE_BASE64" ]; then
112+ echo "ERROR: APPLE_CERTIFICATE_BASE64 is empty!"
113+ exit 1
114+ else
115+ echo "APPLE_CERTIFICATE_BASE64: Set (length: ${#APPLE_CERTIFICATE_BASE64})"
116+ fi
117+ if [ -z "$APPLE_CERTIFICATE_PASSWORD" ]; then
118+ echo "WARNING: APPLE_CERTIFICATE_PASSWORD is empty"
119+ else
120+ echo "APPLE_CERTIFICATE_PASSWORD: Set (length: ${#APPLE_CERTIFICATE_PASSWORD})"
121+ fi
122+
112123 # Create temporary keychain with proper extension
113124 security create-keychain -p temp-password build.keychain
114125 security default-keychain -s build.keychain
@@ -121,8 +132,23 @@ jobs:
121132 # Import certificate with -A flag to avoid access control issues
122133 echo "$APPLE_CERTIFICATE_BASE64" | base64 --decode > certificate.p12
123134
135+ # Debug: Check p12 file
136+ echo "=== Checking .p12 file ==="
137+ ls -la certificate.p12
138+ file certificate.p12
139+
124140 # Import certificate (should contain both cert and private key)
141+ echo "=== Importing certificate ==="
125142 security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -A -T /usr/bin/codesign
143+ IMPORT_RESULT=$?
144+ echo "Import exit code: $IMPORT_RESULT"
145+
146+ # Debug: List all items in keychain
147+ echo "=== All certificates in build.keychain ==="
148+ security find-certificate -a build.keychain || true
149+
150+ echo "=== All identities (including non-codesigning) ==="
151+ security find-identity -v build.keychain || true
126152
127153 # Import Apple intermediate certificate (DER format)
128154 curl -o DeveloperIDG2CA.cer https://www.apple.com/certificateauthority/DeveloperIDG2CA.cer
@@ -139,7 +165,7 @@ jobs:
139165 rm certificate.p12 DeveloperIDG2CA.cer AppleWWDRCAG3.cer
140166
141167 - name : Code Sign Binary (macOS only)
142- if : ( matrix.os == 'macos-latest' || matrix.os == 'macos-14') && env.APPLE_SIGNING_ENABLED == 'true '
168+ if : matrix.os == 'macos-latest' || matrix.os == 'macos-14'
143169 env :
144170 APPLE_SIGNING_IDENTITY : ${{ secrets.APPLE_SIGNING_IDENTITY }}
145171 run : |
@@ -158,7 +184,7 @@ jobs:
158184 /usr/bin/codesign --verify --verbose ./target/${{ matrix.target }}/release/${{ matrix.output_name }}
159185
160186 - name : Notarize Binary (macOS only)
161- if : ( matrix.os == 'macos-latest' || matrix.os == 'macos-14') && env.APPLE_NOTARIZATION_ENABLED == 'true '
187+ if : matrix.os == 'macos-latest' || matrix.os == 'macos-14'
162188 env :
163189 APPLE_API_KEY_BASE64 : ${{ secrets.APPLE_API_KEY_BASE64 }}
164190 APPLE_API_KEY_ID : ${{ secrets.APPLE_API_KEY_ID }}
0 commit comments