Skip to content

Commit 1a0570b

Browse files
committed
more logging
1 parent ac23d19 commit 1a0570b

1 file changed

Lines changed: 41 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,26 @@ jobs:
3333
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
3434
run: |
3535
echo "$APPLE_CERTIFICATE" | base64 --decode > certificate.p12
36-
security create-keychain -p "" build.keychain
36+
37+
# Create and configure keychain
38+
security create-keychain -p "build" build.keychain
3739
security default-keychain -s build.keychain
38-
security unlock-keychain -p "" build.keychain
39-
security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign -T /usr/bin/security
40-
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "" build.keychain
40+
security unlock-keychain -p "build" build.keychain
41+
security set-keychain-settings -t 3600 -u build.keychain
42+
43+
# Import certificate
44+
security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
45+
46+
# Allow codesign to access keychain without prompting
47+
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "build" build.keychain
48+
49+
# Add to search list
50+
security list-keychains -d user -s build.keychain $(security list-keychains -d user | tr -d '"')
51+
52+
# Verify import was successful
53+
echo "=== Verifying certificate import ==="
54+
security find-identity -v -p codesigning build.keychain
55+
4156
rm certificate.p12
4257
4358
- name: Build application
@@ -48,10 +63,31 @@ jobs:
4863
env:
4964
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
5065
run: |
51-
# Find the signing identity
66+
# List all available signing identities
67+
echo "=== Available signing identities ==="
68+
security find-identity -v -p codesigning build.keychain
69+
70+
# Find the signing identity (try Developer ID first, then any valid identity)
5271
IDENTITY=$(security find-identity -v -p codesigning build.keychain | grep "Developer ID Application" | head -1 | awk -F'"' '{print $2}')
72+
73+
if [ -z "$IDENTITY" ]; then
74+
echo "No Developer ID Application found, trying Apple Distribution..."
75+
IDENTITY=$(security find-identity -v -p codesigning build.keychain | grep "Apple Distribution" | head -1 | awk -F'"' '{print $2}')
76+
fi
77+
78+
if [ -z "$IDENTITY" ]; then
79+
echo "No Apple Distribution found, using first valid identity..."
80+
IDENTITY=$(security find-identity -v -p codesigning build.keychain | grep -E "^[[:space:]]+[0-9]+" | head -1 | awk -F'"' '{print $2}')
81+
fi
82+
5383
echo "Using identity: $IDENTITY"
5484
85+
if [ -z "$IDENTITY" ]; then
86+
echo "ERROR: No valid signing identity found!"
87+
echo "Make sure APPLE_CERTIFICATE contains a Developer ID Application certificate"
88+
exit 1
89+
fi
90+
5591
# Sign the native mouse-telemetry binary with hardened runtime
5692
if [ -f "native/mouse-telemetry" ]; then
5793
codesign --force --options runtime --timestamp --sign "$IDENTITY" native/mouse-telemetry

0 commit comments

Comments
 (0)