-
Notifications
You must be signed in to change notification settings - Fork 48
75 lines (63 loc) · 2.94 KB
/
validate-for-app-store.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Validate For App Store
on:
pull_request:
types: [ labeled ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
validate_for_app_store:
if: ${{ github.event.label.name == 'Validate For App Store' }}
name: Validate
environment: AppStoreValidation
runs-on: macos-12-xl
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
BUILD_PROVISION_PROFILE_BASE64_DEBUG: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64_DEBUG }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
PP_PATH_DEBUG=$RUNNER_TEMP/build_pp_debug.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64_DEBUG" | base64 --decode -o $PP_PATH_DEBUG
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH_DEBUG ~/Library/MobileDevice/Provisioning\ Profiles
- name: Build the App
run: |
cd "iOS Example Frame SPM"
xcodebuild -scheme "iOS Example Frame" archive \
-configuration "Release" \
-archivePath "iOS Example Frame.xcarchive"
- name: Export IPA
run: |
cd "iOS Example Frame SPM"
xcodebuild -exportArchive \
-archivePath "iOS Example Frame.xcarchive" \
-exportPath . \
-exportOptionsPlist "ExportOptions.plist"
- name: Validate IPA
env:
APPSTOREVALIDATIONUSERNAME: ${{ secrets.APPSTOREVALIDATIONUSERNAME }}
APPSTOREVALIDATIONPASSWORD: ${{ secrets.APPSTOREVALIDATIONPASSWORD }}
run: |
cd "iOS Example Frame SPM"
xcrun altool --validate-app -f "iOS Example Frame.ipa" \
-u "${APPSTOREVALIDATIONUSERNAME}" -p "${APPSTOREVALIDATIONPASSWORD}" \
-type ios \
--show-progress \
--output-format json