Skip to content

Commit 0147c45

Browse files
author
ebreen
committed
fix(distribution): auto archive + manual export with default keychain and inline plist
1 parent 8579eb8 commit 0147c45

1 file changed

Lines changed: 25 additions & 12 deletions

File tree

.github/workflows/release.yml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,43 +77,56 @@ jobs:
7777
- name: Archive
7878
env:
7979
TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
80-
SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
80+
API_KEY_ID: ${{ secrets.API_KEY_ID }}
81+
API_ISSUER_ID: ${{ secrets.API_ISSUER_ID }}
8182
run: |
8283
xcodebuild archive \
8384
-project CloudMount.xcodeproj \
8485
-scheme CloudMount \
8586
-archivePath "$RUNNER_TEMP/CloudMount.xcarchive" \
8687
-configuration Release \
87-
CODE_SIGN_STYLE=Manual \
88-
DEVELOPMENT_TEAM="$TEAM_ID" \
89-
CODE_SIGN_IDENTITY="$SIGNING_IDENTITY" \
90-
PROVISIONING_PROFILE_SPECIFIER=""
88+
-allowProvisioningUpdates \
89+
-authenticationKeyPath "$RUNNER_TEMP/AuthKey.p8" \
90+
-authenticationKeyID "$API_KEY_ID" \
91+
-authenticationKeyIssuerID "$API_ISSUER_ID" \
92+
DEVELOPMENT_TEAM="$TEAM_ID"
9193
9294
- name: Export archive
9395
env:
9496
TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
9597
SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
98+
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
9699
run: |
100+
# Make our keychain the default so exportArchive finds the Developer ID cert
101+
KEYCHAIN_PATH="$RUNNER_TEMP/app-signing.keychain-db"
102+
security default-keychain -s "$KEYCHAIN_PATH"
103+
security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
104+
97105
EXPORT_PLIST="$RUNNER_TEMP/export-options.plist"
98-
cat > "$EXPORT_PLIST" << 'EOF'
106+
cat > "$EXPORT_PLIST" <<EOF
99107
<?xml version="1.0" encoding="UTF-8"?>
100108
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
101109
<plist version="1.0">
102110
<dict>
103111
<key>method</key>
104112
<string>developer-id</string>
113+
<key>teamID</key>
114+
<string>${TEAM_ID}</string>
105115
<key>signingStyle</key>
106116
<string>manual</string>
117+
<key>signingCertificate</key>
118+
<string>${SIGNING_IDENTITY}</string>
119+
<key>provisioningProfiles</key>
120+
<dict>
121+
<key>com.cloudmount.app</key>
122+
<string>CloudMount Developer ID</string>
123+
<key>com.cloudmount.app.extension</key>
124+
<string>CloudMount Extension Developer ID</string>
125+
</dict>
107126
</dict>
108127
</plist>
109128
EOF
110129
111-
/usr/libexec/PlistBuddy -c "Add :teamID string $TEAM_ID" "$EXPORT_PLIST"
112-
/usr/libexec/PlistBuddy -c "Add :signingCertificate string $SIGNING_IDENTITY" "$EXPORT_PLIST"
113-
/usr/libexec/PlistBuddy -c "Add :provisioningProfiles dict" "$EXPORT_PLIST"
114-
/usr/libexec/PlistBuddy -c "Add :provisioningProfiles:com.cloudmount.app string CloudMount Developer ID" "$EXPORT_PLIST"
115-
/usr/libexec/PlistBuddy -c "Add :provisioningProfiles:com.cloudmount.app.extension string CloudMount Extension Developer ID" "$EXPORT_PLIST"
116-
117130
xcodebuild -exportArchive \
118131
-archivePath "$RUNNER_TEMP/CloudMount.xcarchive" \
119132
-exportPath "$RUNNER_TEMP/export" \

0 commit comments

Comments
 (0)