Skip to content

Commit 3dd7c57

Browse files
author
ebreen
committed
fix(distribution): use automatic signing with API key auth for CI
1 parent b81c8ed commit 3dd7c57

2 files changed

Lines changed: 22 additions & 11 deletions

File tree

.github/workflows/release.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,35 +59,48 @@ jobs:
5959
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${{ github.run_number }}" CloudMount/Info.plist
6060
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${{ github.run_number }}" CloudMountExtension/Info.plist
6161
62+
- name: Decode API key for Xcode
63+
env:
64+
APP_STORE_CONNECT_KEY_BASE64: ${{ secrets.APP_STORE_CONNECT_KEY_BASE64 }}
65+
run: |
66+
echo -n "$APP_STORE_CONNECT_KEY_BASE64" | base64 --decode -o "$RUNNER_TEMP/AuthKey.p8"
67+
6268
- name: Archive
6369
env:
6470
TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
65-
SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
71+
API_KEY_ID: ${{ secrets.API_KEY_ID }}
72+
API_ISSUER_ID: ${{ secrets.API_ISSUER_ID }}
6673
run: |
6774
xcodebuild archive \
6875
-project CloudMount.xcodeproj \
6976
-scheme CloudMount \
7077
-archivePath "$RUNNER_TEMP/CloudMount.xcarchive" \
7178
-configuration Release \
72-
CODE_SIGN_STYLE=Manual \
73-
DEVELOPMENT_TEAM="$TEAM_ID" \
74-
CODE_SIGN_IDENTITY="$SIGNING_IDENTITY"
79+
-allowProvisioningUpdates \
80+
-authenticationKeyPath "$RUNNER_TEMP/AuthKey.p8" \
81+
-authenticationKeyID "$API_KEY_ID" \
82+
-authenticationKeyIssuerID "$API_ISSUER_ID" \
83+
DEVELOPMENT_TEAM="$TEAM_ID"
7584
7685
- name: Export archive
7786
env:
7887
TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
79-
SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
88+
API_KEY_ID: ${{ secrets.API_KEY_ID }}
89+
API_ISSUER_ID: ${{ secrets.API_ISSUER_ID }}
8090
run: |
81-
# Inject teamID into export options
8291
EXPORT_PLIST="$RUNNER_TEMP/export-options.plist"
8392
cp scripts/export-options.plist "$EXPORT_PLIST"
8493
/usr/libexec/PlistBuddy -c "Add :teamID string $TEAM_ID" "$EXPORT_PLIST"
85-
/usr/libexec/PlistBuddy -c "Set :signingCertificate $SIGNING_IDENTITY" "$EXPORT_PLIST"
94+
/usr/libexec/PlistBuddy -c "Set :signingStyle automatic" "$EXPORT_PLIST"
8695
8796
xcodebuild -exportArchive \
8897
-archivePath "$RUNNER_TEMP/CloudMount.xcarchive" \
8998
-exportPath "$RUNNER_TEMP/export" \
90-
-exportOptionsPlist "$EXPORT_PLIST"
99+
-exportOptionsPlist "$EXPORT_PLIST" \
100+
-allowProvisioningUpdates \
101+
-authenticationKeyPath "$RUNNER_TEMP/AuthKey.p8" \
102+
-authenticationKeyID "$API_KEY_ID" \
103+
-authenticationKeyIssuerID "$API_ISSUER_ID"
91104
92105
- name: Verify code signature
93106
run: |

scripts/export-options.plist

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
<key>method</key>
66
<string>developer-id</string>
77
<key>signingStyle</key>
8-
<string>manual</string>
9-
<key>signingCertificate</key>
10-
<string>Developer ID Application</string>
8+
<string>automatic</string>
119
</dict>
1210
</plist>

0 commit comments

Comments
 (0)