Skip to content

Commit 4d9e1aa

Browse files
committed
test ios archive signing
1 parent 52cf4c6 commit 4d9e1aa

1 file changed

Lines changed: 53 additions & 53 deletions

File tree

.github/workflows/ios-action.yml

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -84,61 +84,61 @@ jobs:
8484
-scheme "App" \
8585
-configuration "Release Production" | egrep "CODE_SIGN|PROVISION|PRODUCT_BUNDLE_IDENTIFIER|DEVELOPMENT_TEAM"
8686
87-
- name: Show code signing identities
88-
run: |
89-
security find-identity -v -p codesigning
90-
91-
- name: Inspect provisioning profile
92-
run: |
93-
PROFILE=$(ls "$HOME/Library/MobileDevice/Provisioning Profiles"/*.mobileprovision | head -n1)
94-
security cms -D -i "$PROFILE" > $RUNNER_TEMP/profile.plist
95-
echo "Profile Name: $(/usr/libexec/PlistBuddy -c 'Print Name' $RUNNER_TEMP/profile.plist)"
96-
echo "Bundle ID: $(/usr/libexec/PlistBuddy -c 'Print Entitlements:application-identifier' $RUNNER_TEMP/profile.plist)"
97-
# Print SHA-1 fingerprints of DeveloperCertificates embedded in the profile
98-
python3 - <<'PY'
99-
import plistlib, base64, subprocess, os
100-
p=plistlib.load(open(os.environ['RUNNER_TEMP']+'/profile.plist','rb'))
101-
for i, der_b64 in enumerate(p.get('DeveloperCertificates', [])):
102-
der = base64.b64decode(der_b64)
103-
path = f"{os.environ['RUNNER_TEMP']}/cert{i}.cer"
104-
open(path,'wb').write(der)
105-
out = subprocess.check_output(['openssl','x509','-inform','DER','-in',path,'-noout','-subject','-serial','-fingerprint','-sha1']).decode()
106-
print(f"Profile cert[{i}]:\n{out}")
107-
PY
108-
109-
# - name: Build archive
110-
# env:
111-
# TEAM_ID: ${{ secrets.APPSTORE_TEAM_ID }}
87+
# - name: Show code signing identities
11288
# run: |
113-
# set -euo pipefail
114-
# cd ios/App
115-
# xcodebuild \
116-
# -workspace "App.xcworkspace" \
117-
# -scheme "App" \
118-
# -configuration "Release Production" \
119-
# -archivePath "$GITHUB_WORKSPACE/App.xcarchive" \
120-
# -destination "generic/platform=iOS" \
121-
# DEVELOPMENT_TEAM="$TEAM_ID" \
122-
# CODE_SIGN_STYLE=Manual \
123-
# CODE_SIGNING_ALLOWED=NO \
124-
# CODE_SIGNING_REQUIRED=NO \
125-
# CODE_SIGN_IDENTITY="" \
126-
# PROVISIONING_PROFILE_SPECIFIER="" \
127-
# PROVISIONING_PROFILE="" \
128-
# clean archive
129-
130-
# - name: Export IPA
131-
# env:
132-
# EXPORT_PLIST_B64: ${{ secrets.IOS_EXPORT_PRODUCTION }}
89+
# security find-identity -v -p codesigning
90+
91+
# - name: Inspect provisioning profile
13392
# run: |
134-
# set -euo pipefail
135-
# EXPORT_PLIST=$RUNNER_TEMP/ExportOptions.plist
136-
# echo -n "$EXPORT_PLIST_B64" | base64 --decode > "$EXPORT_PLIST"
137-
# cd ios/App
138-
# xcodebuild -exportArchive \
139-
# -archivePath "$GITHUB_WORKSPACE/App.xcarchive" \
140-
# -exportOptionsPlist "$EXPORT_PLIST" \
141-
# -exportPath "$RUNNER_TEMP/export"
93+
# PROFILE=$(ls "$HOME/Library/MobileDevice/Provisioning Profiles"/*.mobileprovision | head -n1)
94+
# security cms -D -i "$PROFILE" > $RUNNER_TEMP/profile.plist
95+
# echo "Profile Name: $(/usr/libexec/PlistBuddy -c 'Print Name' $RUNNER_TEMP/profile.plist)"
96+
# echo "Bundle ID: $(/usr/libexec/PlistBuddy -c 'Print Entitlements:application-identifier' $RUNNER_TEMP/profile.plist)"
97+
# # Print SHA-1 fingerprints of DeveloperCertificates embedded in the profile
98+
# python3 - <<'PY'
99+
# import plistlib, base64, subprocess, os
100+
# p=plistlib.load(open(os.environ['RUNNER_TEMP']+'/profile.plist','rb'))
101+
# for i, der_b64 in enumerate(p.get('DeveloperCertificates', [])):
102+
# der = base64.b64decode(der_b64)
103+
# path = f"{os.environ['RUNNER_TEMP']}/cert{i}.cer"
104+
# open(path,'wb').write(der)
105+
# out = subprocess.check_output(['openssl','x509','-inform','DER','-in',path,'-noout','-subject','-serial','-fingerprint','-sha1']).decode()
106+
# print(f"Profile cert[{i}]:\n{out}")
107+
# PY
108+
109+
- name: Build archive
110+
env:
111+
TEAM_ID: ${{ secrets.APPSTORE_TEAM_ID }}
112+
run: |
113+
set -euo pipefail
114+
cd ios/App
115+
xcodebuild \
116+
-workspace "App.xcworkspace" \
117+
-scheme "App" \
118+
-configuration "Release Production" \
119+
-archivePath "$GITHUB_WORKSPACE/App.xcarchive" \
120+
-destination "generic/platform=iOS" \
121+
DEVELOPMENT_TEAM="$TEAM_ID" \
122+
CODE_SIGN_STYLE=Manual \
123+
CODE_SIGNING_ALLOWED=NO \
124+
CODE_SIGNING_REQUIRED=NO \
125+
CODE_SIGN_IDENTITY="" \
126+
PROVISIONING_PROFILE_SPECIFIER="" \
127+
PROVISIONING_PROFILE="" \
128+
clean archive
129+
130+
- name: Export IPA
131+
env:
132+
EXPORT_PLIST_B64: ${{ secrets.IOS_EXPORT_PRODUCTION }}
133+
run: |
134+
set -euo pipefail
135+
EXPORT_PLIST=$RUNNER_TEMP/ExportOptions.plist
136+
echo -n "$EXPORT_PLIST_B64" | base64 --decode > "$EXPORT_PLIST"
137+
cd ios/App
138+
xcodebuild -exportArchive \
139+
-archivePath "$GITHUB_WORKSPACE/App.xcarchive" \
140+
-exportOptionsPlist "$EXPORT_PLIST" \
141+
-exportPath "$RUNNER_TEMP/export"
142142
143143
# - name: Save App Store Connect API key (.p8)
144144
# env:

0 commit comments

Comments
 (0)