-
-
Notifications
You must be signed in to change notification settings - Fork 693
190 lines (169 loc) · 6.65 KB
/
build.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
name: Build and Upload Provenance
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
cancel-in-progress: true
env:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
SWIFT_PACKAGE_ALLOW_WRITING_TO_DIRECTORY: ${{ github.workspace }}
jobs:
build:
name: Build and upload Provenance
strategy:
fail-fast: false
matrix:
target:
- Provenance-Release
- ProvenanceTV-Release
- "Provenance-XL Release"
- "Provenance-Lite Release"
- Provenance-UnderDevelopment
include:
- target: Provenance-Release
sdk: iphoneos
scheme: Provenance-Release
APP_NAME: Provenance
IPA_NAME: Provenance
- target: ProvenanceTV-Release
sdk: appletvos
scheme: ProvenanceTV-Release
APP_NAME: Provenance
IPA_NAME: ProvenanceTV
- target: Provenance-Release
sdk: appletvos
scheme: Provenance-Release
APP_NAME: Provenance
IPA_NAME: Provenance-tvOS
- target: "Provenance-XL Release"
sdk: iphoneos
scheme: "Provenance-XL Release"
APP_NAME: Provenance-XL
IPA_NAME: Provenance-XL
- target: "Provenance-Lite Release"
sdk: iphoneos
scheme: "Provenance-Lite Release"
APP_NAME: Provenance-Lite
IPA_NAME: Provenance-Lite
- target: Provenance-UnderDevelopment
sdk: iphoneos
scheme: Provenance-UnderDevelopment
APP_NAME: Provenance-UnderDevelopment
IPA_NAME: Provenance-UnderDevelopment
# - target: macOS
# sdk: macosx
# scheme: Provenance
runs-on: 'macos-latest'
timeout-minutes: 300
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive
# - name: Install Xcode
# uses: maxim-lobanov/setup-xcode@v1
# with:
# xcode-version: ${{ matrix.version }}
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1.6.0
with:
xcode-version: '16.0'
# xcode-select-path: /Applications/Xcode_${{ matrix.version }}.app/Contents/Developer
- uses: actions/cache@v3
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
- name: Install dependencies
run: brew install ldid
- name: Cache DerivedData
uses: irgaly/xcode-cache@v1
with:
key: xcode-cache-deriveddata-${{ github.workflow }}-${{ github.sha }}
restore-keys: xcode-cache-deriveddata-${{ github.workflow }}-
- name: Install Swift Package Cache
run: |
mkdir -p ${{ env.SWIFT_PACKAGE_ALLOW_WRITING_TO_DIRECTORY }}
chmod -R u+w ${{ env.SWIFT_PACKAGE_ALLOW_WRITING_TO_DIRECTORY }}
- name: Activate IDESkipMacroFingerprintValidation
run: |
defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES
# - name: Import Codesign Certificates
# uses: apple-actions/import-codesign-certs@v1
# with:
# p12-file-base64: ${{ secrets.CERT_P12 }}
# p12-password: ${{ secrets.P12_PASS }}
#- name: Import Codesign Certificates
# uses: apple-actions/import-codesign-certs@v2
# with:
# p12-file-base64: ${{ secrets.CERT_P12 }}
# p12-password: ${{ secrets.P12_PASS }}
- name: Build Provenance
run: |
xcodebuild -configuration Release \
-workspace Provenance.xcworkspace \
-scheme "${{ matrix.scheme }}" \
-sdk ${{ matrix.sdk }} \
-skipPackagePluginValidation \
-skipMacroValidation \
archive \
-archivePath ./archive \
CODE_SIGNING_REQUIRED=NO \
AD_HOC_CODE_SIGNING_ALLOWED=YES \
CODE_SIGNING_ALLOWED=NO \
SWIFT_PACKAGE_ALLOW_WRITING_TO_DIRECTORY=${{ env.SWIFT_PACKAGE_ALLOW_WRITING_TO_DIRECTORY }} \
DEVELOPMENT_TEAM=S32Z3HMYVQ \
ORG_IDENTIFIER=org.provenance-emu \
| xcpretty && exit ${PIPESTATUS[0]}
# - name: Build Provenance
# run: |
# rm -rf ~/Library/Developer/Xcode/DerivedData/
# rm ./Provenance.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
# rm ./Provenance.xcworkspace/xcshareddata/swiftpm/Package.resolved
# xcodebuild -workspace Provenance.xcworkspace -scheme Provenance-Release -sdk iphoneos archive -archivePath ./archive CODE_SIGNING_REQUIRED=NO AD_HOC_CODE_SIGNING_ALLOWED=YES CODE_SIGNING_ALLOWED=NO DEVELOPMENT_TEAM=XYZ0123456 ORG_IDENTIFIER=org.provenance-emu | xcpretty && exit ${PIPESTATUS[0]}
- name: Fakesign app
run: |
#rm -rf archive.xcarchive/Products/Applications/${{ matrix.APP_NAME }}.app/Frameworks/*.framework/Frameworks/
ldid -SProvenance/Provenance.entitlements archive.xcarchive/Products/Applications/${{ matrix.APP_NAME }}.app/${{ matrix.APP_NAME }}
- name: Convert to IPA
run: |
mkdir Payload
cp -pR "archive.xcarchive/Products/Applications/${{ matrix.APP_NAME }}.app" "Payload/${{ matrix.IPA_NAME }}.app"
zip -r "${{ matrix.IPA_NAME }}.ipa" Payload
# - name: Codesign IPA
# uses: mmaetzler/ios-resign-action@d3c2e4cb930bc7edf89894af7af622d3c0d5b571
# with:
# ipa_path: "${{ matrix.IPA_NAME }}.ipa"
# mobileprovision: ${{ secrets.MOBILEPROVISION }}
# cert_p12: ${{ secrets.CERT_P12 }}
# p12_pass: ${{ secrets.P12_PASS }}
# signing_identity: ${{ secrets.SIGNING_IDENTITY }}
- name: Upload Artifact
uses: actions/upload-artifact@v3.1.0
with:
name: "${{ matrix.IPA_NAME }}.ipa"
path: "${{ matrix.IPA_NAME }}.ipa"
# - name: Upload IPA to S3
# if: ${{ github.branch == 'develop' }}
# uses: ebuckthal/s3-upload-artifact@v7
# with:
# bucket: 'sh-sysops'
# key: ${AWS_SECRET_ACCESS_KEY}
# path: 'Provenance.ipa'
# - name: Upload IPA to App Center
# uses: wzieba/AppCenter-Github-Action@v1
# if: ${{ github.branch == 'develop' }}
# with:
# appName: wzieba/Sample-App
# token: ${{secrets.APP_CENTER_TOKEN}}
# group: Testers
# file: Provenance.ipa
# notifyTesters: true
# debug: false