-
Notifications
You must be signed in to change notification settings - Fork 12
148 lines (118 loc) · 5.96 KB
/
ios.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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Meowbili iDevice Workflow
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
name: Build and Archive App
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Xcode Version
run: sudo xcode-select -s /Applications/Xcode_15.0.app
- name: Get App Store Connect API Key File
env:
ASCAPI_KEY: ${{ secrets.ASCAPI_KEY }}
run: |
KEY_PATH=$RUNNER_TEMP/ascapi-key.p8
echo -n "$ASCAPI_KEY" > $KEY_PATH
- name: Resolve Swift dependencies
run: |
xcodebuild -resolvePackageDependencies -scheme DarockBili -configuration Debug
xcodebuild -resolvePackageDependencies -scheme DarockBili -configuration Release
- name: Archive DarockBili App
env:
ASCAPI_KEY_ID: ${{ secrets.ASCAPI_KEY_ID }}
ASCAPI_ISSUER_ID: ${{ secrets.ASCAPI_ISSUER_ID }}
run: |
KEY_PATH=$RUNNER_TEMP/ascapi-key.p8
xcodebuild -scheme DarockBili -configuration Debug DEVELOPMENT_TEAM=B57D8PP775 -sdk 'iphoneos' -destination 'generic/platform=iOS' -archivePath DarockBili_Debug.xcarchive clean archive CODE_SIGN_IDENTITY="Apple Development" -allowProvisioningUpdates -authenticationKeyPath $KEY_PATH -authenticationKeyID $ASCAPI_KEY_ID -authenticationKeyIssuerID $ASCAPI_ISSUER_ID
xcodebuild -scheme DarockBili -configuration Release DEVELOPMENT_TEAM=B57D8PP775 -sdk 'iphoneos' -destination 'generic/platform=iOS' -archivePath DarockBili_Release.xcarchive clean archive CODE_SIGN_IDENTITY="Apple Development" -allowProvisioningUpdates -authenticationKeyPath $KEY_PATH -authenticationKeyID $ASCAPI_KEY_ID -authenticationKeyIssuerID $ASCAPI_ISSUER_ID
xcodebuild -scheme DarockBili -configuration Release DEVELOPMENT_TEAM=B57D8PP775 -sdk 'iphoneos' -destination 'generic/platform=iOS' -archivePath DarockBili_Release_d.xcarchive clean archive CODE_SIGN_IDENTITY="Apple Distribution" -allowProvisioningUpdates -authenticationKeyPath $KEY_PATH -authenticationKeyID $ASCAPI_KEY_ID -authenticationKeyIssuerID $ASCAPI_ISSUER_ID
- name: Export IPA
run: |
mkdir ./Export_Debug
mkdir ./Export_Release
mkdir ./Export_Release_d
xcodebuild -exportArchive -archivePath DarockBili_Debug.xcarchive -exportPath ./Export_Debug -exportOptionsPlist ExportOptions.plist
xcodebuild -exportArchive -archivePath DarockBili_Release.xcarchive -exportPath ./Export_Release -exportOptionsPlist ExportOptions.plist
xcodebuild -exportArchive -archivePath DarockBili_Release_d.xcarchive -exportPath ./Export_Release_d -exportOptionsPlist ExportOptions.plist
- name: Upload Debug IPA
uses: actions/upload-artifact@v3
with:
name: Debug.ipa
path: ./Export_Debug/DarockBili.ipa
- name: Upload Release IPA
uses: actions/upload-artifact@v3
with:
name: Release.ipa
path: ./Export_Release/DarockBili.ipa
- name: Upload Release Distribution IPA
uses: actions/upload-artifact@v3
with:
name: Release_Distribution.ipa
path: ./Export_Release_d/DarockBili.ipa
build_for_testing:
runs-on: macos-13
name: Test App
steps:
- uses: actions/checkout@v3
- name: Set Xcode Version
run: sudo xcode-select -s /Applications/Xcode_15.0.app
- name: Resolve Swift dependencies
run: xcodebuild -resolvePackageDependencies -scheme 'DarockBili Watch App' -configuration Release
- name: Prepare Cache Folder
run: mkdir Caches
- name: Build
run: xcodebuild build-for-testing -project ./DarockBili.xcodeproj -scheme 'DarockBili Watch App' -configuration Release -destination 'platform=watchOS Simulator,name=Apple Watch Series 7 (41mm),OS=10.0' -destination 'platform=watchOS Simulator,name=Apple Watch Series 9 (45mm),OS=10.0' -testPlan WatchAppUITestPlan -testProductsPath ./Caches/TestProducts.xctestproducts -derivedDataPath ./Caches/DerivedData | tee TestBuilding.log
- name: Upload Building Log
uses: actions/upload-artifact@v3
with:
name: Watch Test Building Log
path: ./TestBuilding.log
- name: Update Caches
uses: actions/cache@v3
with:
key: XCTest-Build-Cache-${{ github.sha }}
path: ./Caches
test_watch1:
runs-on: macos-13
name: Test on Apple Watch Series 7 (41mm)
needs:
- build_for_testing
steps:
- uses: actions/checkout@v3
- name: Restore Caches
uses: actions/cache@v3
with:
key: XCTest-Build-Cache-${{ github.sha }}
path: ./Caches
- name: Test
run: xcodebuild test-without-building -configuration Release -destination 'platform=watchOS Simulator,name=Apple Watch Series 7 (41mm),OS=10.0' -testPlan WatchAppUITestPlan -testProductsPath ./Caches/TestProducts.xctestproducts -derivedDataPath ./Caches/DerivedData
- name: Upload Downloads Folder
uses: actions/upload-artifact@v3
with:
name: Files in Downloads Folder1
path: ~/Downloads
test_watch2:
runs-on: macos-13
name: Test on Apple Watch Series 9 (45mm)
needs:
- build_for_testing
steps:
- uses: actions/checkout@v3
- name: Restore Caches
uses: actions/cache@v3
with:
key: XCTest-Build-Cache-${{ github.sha }}
path: ./Caches
- name: Test
run: xcodebuild test-without-building -configuration Release -destination 'platform=watchOS Simulator,name=Apple Watch Series 9 (45mm),OS=10.0' -testPlan WatchAppUITestPlan -testProductsPath ./Caches/TestProducts.xctestproducts -derivedDataPath ./Caches/DerivedData
- name: Upload Downloads Folder
uses: actions/upload-artifact@v3
with:
name: Files in Downloads Folder2
path: ~/Downloads