-
-
Notifications
You must be signed in to change notification settings - Fork 20
134 lines (118 loc) · 4.82 KB
/
ios-testflight-release.yaml
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: iOS TestFlight Release
on:
push:
tags:
- '*-ios'
jobs:
deploy:
runs-on: macos-14
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Xcode version
run: |
/usr/bin/xcodebuild -version
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Xcode version
run: |
/usr/bin/xcodebuild -version
- name: Setup Gradle
uses: ./.github/actions/setup-gradle
with:
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
- name: Create Dummy Firebase Plist
run: |
cp config/dummy-google-service.plist iosApp/dummy-google-service.plist
mv iosApp/dummy-google-service.plist iosApp/GoogleService-Info-dev.plist
- name: Create Firebase Plist
run: |
echo "$FIREBASE_PLIST" > iosApp/GoogleService-Info.plist.b64
base64 -d -i iosApp/GoogleService-Info.plist.b64 > iosApp/GoogleService-Info.plist
env:
FIREBASE_PLIST: ${{ secrets.FIREBASE_PLIST }}
- name: Create Config xcconfig
run: |
echo "DROPBOX_URL_SCHEME=db-$DROPBOX_API_KEY" >> iosApp/Assets/Config.xcconfig
echo "DROPBOX_API_KEY=$DROPBOX_API_KEY" >> iosApp/Assets/Config.xcconfig
env:
DROPBOX_API_KEY: ${{ secrets.DROPBOX_API_KEY }}
- name: import certs
uses: apple-actions/import-codesign-certs@v3
with:
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_PASSWORD }}
- name: download provisioning profiles
uses: apple-actions/download-provisioning-profiles@v3
with:
bundle-id: ${{ secrets.BUNDLE_ID }}
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }}
- name: build archive
run: |
cd iosApp
xcrun xcodebuild \
-scheme "FeedFlow" \
-configuration "Release" \
-sdk "iphoneos" \
-parallelizeTargets \
-showBuildTimingSummary \
-disableAutomaticPackageResolution \
-derivedDataPath "${RUNNER_TEMP}/Build/DerivedData" \
-archivePath "${RUNNER_TEMP}/Build/Archives/FeedFlow.xcarchive" \
-resultBundlePath "${RUNNER_TEMP}/Build/Artifacts/FeedFlow.xcresult" \
-destination "generic/platform=iOS" \
DEVELOPMENT_TEAM="${{ secrets.APPSTORE_TEAM_ID }}" \
PRODUCT_BUNDLE_IDENTIFIER="${{ secrets.BUNDLE_ID }}" \
CODE_SIGN_STYLE="Manual" \
PROVISIONING_PROFILE_SPECIFIER="${{ secrets.DEV_PROVISIONING_PROFILE_NAME }}" \
archive | xcbeautify --renderer github-actions
- name: "Generate ExportOptions.plist"
run: |
cat <<EOF > ${RUNNER_TEMP}/Build/ExportOptions.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>destination</key>
<string>export</string>
<key>method</key>
<string>app-store</string>
<key>signingStyle</key>
<string>manual</string>
<key>generateAppStoreInformation</key>
<true/>
<key>stripSwiftSymbols</key>
<true/>
<key>teamID</key>
<string>${{ secrets.APPSTORE_TEAM_ID }}</string>
<key>uploadSymbols</key>
<true/>
<key>provisioningProfiles</key>
<dict>
<key>${{ secrets.BUNDLE_ID }}</key>
<string>${{ secrets.DIST_PROVISIONING_PROFILE_NAME }}</string>
</dict>
</dict>
</plist>
EOF
- id: export_archive
name: export archive
run: |
xcrun xcodebuild \
-exportArchive \
-exportOptionsPlist "${RUNNER_TEMP}/Build/ExportOptions.plist" \
-archivePath "${RUNNER_TEMP}/Build/Archives/FeedFlow.xcarchive" \
-exportPath "${RUNNER_TEMP}/Build/Archives/FeedFlow.xcarchive" \
PRODUCT_BUNDLE_IDENTIFIER="${{ secrets.BUNDLE_ID }}" | xcbeautify --renderer github-actions
echo "ipa_path=${RUNNER_TEMP}/Build/Archives/FeedFlow.xcarchive/FeedFlow.ipa" >> $GITHUB_ENV
- uses: Apple-Actions/upload-testflight-build@v1
with:
app-path: ${{ env.ipa_path }}
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }}