-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (69 loc) ยท 2.7 KB
/
TestFlight_deploy.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
75
76
77
78
79
80
81
82
name: TestFlight Deploy
env:
WORKSPACE: iOS/MusicSpot.xcworkspace
SCHEME: MusicSpot-Release
ARCHIVE: MusicSpot.xcarchive
on:
push:
branches:
- 'iOS/release'
- 'iOS/**'
jobs:
deploy:
runs-on: macos-13
env:
DEPLOY_CERTIFICATE_BASE64: ${{ secrets.IOS_DEPLOY_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.IOS_P12_PASSWORD }}
DEPLOY_PROVISION_PROFILE_BASE64: ${{ secrets.IOS_DEPLOY_PROVISION_PROFILE_BASE64 }}
KEYCHAIN_PASSWORD: ${{ secrets.IOS_KEYCHAIN_PASSWD }}
steps:
- uses: actions/checkout@v4
- name: Create secret file
env:
API_SECRET: ${{ secrets.API_SECRET }}
run: |
echo -n $API_SECRET | base64 -D -o iOS/MSData/Sources/MSData/Resources/APIInfo.plist
- name: Setup Deploy Certificates
run: |
CERTIFICATE_PATH=$RUNNER_TEMP/deploy_certificate.p12
PROFILE_PATH=$RUNNER_TEMP/deploy_pp.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
echo -n "$DEPLOY_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
echo -n "$DEPLOY_PROVISION_PROFILE_BASE64" | base64 --decode -o $PROFILE_PATH
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PROFILE_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: Setup Xcode
if: ${{ !env.ACT }}
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.0.1'
- name: Archive
run: |
xcodebuild -workspace $WORKSPACE -list
xcodebuild clean archive \
-workspace $WORKSPACE \
-scheme $SCHEME \
-configuration release \
-archivePath $ARCHIVE
- name: Export
run: |
xcodebuild \
-exportArchive \
-archivePath $ARCHIVE \
-exportOptionsPlist ExportOptions.plist \
-exportPath . \
-allowProvisioningUpdates
- name: Upload to TestFlight
uses: apple-actions/upload-testflight-build@v1
with:
app-path: 'MusicSpot.ipa'
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }}