-
-
Notifications
You must be signed in to change notification settings - Fork 230
207 lines (185 loc) Β· 8.7 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
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
---
name: π iOS
on:
push:
branches:
- master
- release-**
pull_request:
release:
types: ['published']
jobs:
build:
name: build (ios)
runs-on: macos-12
env:
DEPLOYMENT_TARGET: '14.0'
BUILD_TYPE: 'Release'
TRIPLET: 'arm64-ios'
steps:
- name: π£ Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: πΎ Prepare vars
id: vars
shell: bash
run: |
./scripts/ci/env_gh.sh
- uses: Apple-Actions/import-codesign-certs@v2
with:
p12-file-base64: ${{ env.CI_USE_IOS_DIST_CERT && secrets.APPLE_CODESIGN_CERT_BASE64_DIST || secrets.APPLE_CODESIGN_CERT_BASE64_DEV }}
p12-password: ${{ env.CI_USE_IOS_DIST_CERT && secrets.APPLE_CODESIGN_CERT_PASS_DIST || secrets.APPLE_CODESIGN_CERT_PASS_DEV }}
- uses: Apple-Actions/download-provisioning-profiles@v1
with:
bundle-id: ch.opengis.qfield
issuer-id: ${{ secrets.IOS_APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.IOS_APPSTORE_KEY_ID }}
api-private-key: ${{ secrets.IOS_APPSTORE_PRIVATE_KEY }}
- name: π Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 6.5.3
modules: 'qt5compat qtcharts qtpositioning qtconnectivity qtimageformats qtmultimedia qtwebview qtsensors'
target: ios
cache: true
- name: π Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 6.5.3
target: desktop
cache: false
- name: Prepare ios build env
run: |
brew install automake bison flex gnu-sed s3cmd gettext
echo $(brew --prefix bison)/bin >> $GITHUB_PATH
echo $(brew --prefix flex)/bin >> $GITHUB_PATH
echo $(brew --prefix s3cmd)/bin >> $GITHUB_PATH
echo $(brew --prefix gettext)/bin >> $GITHUB_PATH
- uses: maxim-lobanov/[email protected]
with:
xcode-version: latest-stable
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ccache-ios
max-size: 200M
- name: π± Install dependencies and generate project files
run: |
source ./scripts/version_number.sh
source ./scripts/ci/generate-version-details.sh
mkdir -p build
cmake -S "${{ github.workspace }}" \
-B "/Users/runner/builddir" \
-G "Xcode" \
-D CMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-D SYSTEM_QT=ON \
-D VCPKG_TARGET_TRIPLET="${{ env.TRIPLET }}" \
-D WITH_VCPKG=ON \
-D WITH_SPIX=OFF \
-D CMAKE_PREFIX_PATH=${Qt6_DIR} \
-D WITH_BLUETOOTH=OFF \
-D WITH_SERIALPORT=OFF \
-D APP_VERSION="${APP_VERSION}" \
-D APK_VERSION_CODE="${APK_VERSION_CODE}" \
-D APP_VERSION_STR="${APP_VERSION_STR}" \
-D APP_PACKAGE_NAME="${APP_PACKAGE_NAME}" \
-D APP_NAME="${APP_NAME}" \
-D NUGET_USERNAME=opengisch \
-D NUGET_TOKEN=${{ secrets.GITHUB_TOKEN }} \
-D SENTRY_DSN=${{ secrets.SENTRY_DSN }} \
-D SENTRY_ENV="${APP_ENV}" \
-D ENABLE_BITCODE=OFF \
-D ENABLE_ARC=ON \
-D QT_IOS_TEAM_ID="${{ secrets.IOS_TEAM_ID }}" \
-D QT_IOS_CODE_SIGN_IDENTITY="${{env.CI_USE_IOS_DIST_CERT && 'Apple Distribution' || 'Apple Development' }}" \
-D QT_IOS_PROVISIONING_PROFILE_SPECIFIER="${{env.CI_USE_IOS_DIST_CERT && secrets.IOS_PROVISIONING_PROFILE_SPECIFIER || secrets.IOS_PROVISIONING_PROFILE_SPECIFIER_DEV }}" \
-D QT_IOS_EXPORT_METHOD="${{env.CI_USE_IOS_DIST_CERT && 'app-store' || 'development' }}" \
-D CMAKE_SYSTEM_NAME=iOS \
-D CMAKE_SYSTEM_PROCESSOR=aarch64 \
-D CMAKE_OSX_DEPLOYMENT_TARGET=${{ env.DEPLOYMENT_TARGET }} \
-D QT_HOST_PATH=${{ github.workspace }}/../Qt/6.5.3/macos \
-D QT_HOST_PATH_CMAKE_DIR:PATH=${{ github.workspace }}/../Qt/6.5.3/macos \
-D ENABLE_TESTS=OFF \
-D CMAKE_CXX_VISIBILITY_PRESET=hidden \
-D WITH_CCACHE=ON
- name: π Upload Dep Build Logs
uses: actions/upload-artifact@v3
if: failure()
with:
name: build-logs-${{ env.TRIPLET }}
path: |
/Users/runner/builddir/**/*.log
# Not required, packaging does it all
# - name: π Build
# run: |
# cmake --build /Users/runner/builddir --config ${{ env.BUILD_TYPE }} # --target qfield
- name: Package
run: |
cmake --build /Users/runner/builddir --target bundle --config Release
- name: πΊ Deploy
env:
PLIST_URL: https://sos-ch-dk-2.exo.io/qfieldapks/ci-builds/qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}.pList
IPA_URL: https://sos-ch-dk-2.exo.io/qfieldapks/ci-builds/qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}.ipa
run: |
mv /Users/runner/builddir/qfieldIpa/qfield.ipa qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}.ipa
if [[ -n "${{ secrets.S3CFG }}" ]]
then
echo "${{ secrets.S3CFG }}" > ~/.s3cfg
envsubst < ${{ github.workspace }}/platform/ios/installation-template.html > qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}.html
envsubst < ${{ github.workspace }}/platform/ios/installation-template.plist > qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}.plist
s3cmd put --acl-public -m 'text/html' qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}.html s3://qfieldapks/ci-builds/qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}.html
s3cmd put --acl-public -m 'application/xml' qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}.pList s3://qfieldapks/ci-builds/qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}.pList
s3cmd put --acl-public qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}.ipa s3://qfieldapks/ci-builds/qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}.ipa
echo "Install the ipa from https://sos-ch-dk-2.exo.io/qfieldapks/ci-builds/qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}.html"
rm ~/.s3cfg
fi
- name: π¦ Upload qfield Ipa
uses: actions/upload-artifact@v3
with:
name: qfield-${{ env.TRIPLET }}-${{ env.DEPLOYMENT_TARGET }}.ipa
path: qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}.ipa
- name: π Release to TestFlight
uses: Apple-Actions/upload-testflight-build@v1
if: ${{ env.CI_USE_IOS_DIST_CERT }}
with:
app-path: qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}.ipa
issuer-id: ${{ secrets.IOS_APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.IOS_APPSTORE_KEY_ID }}
api-private-key: ${{ secrets.IOS_APPSTORE_PRIVATE_KEY }}
# Disabled: Is not able to resolve the id of the build at the moment
#
# - name: Enable public testers
# if:env.CI_USE_IOS_DIST_CERT
# run: |
# source ./scripts/version_number.sh
# source ./scripts/ci/generate-version-details.sh
# # Enable public testers
# pip install PyJWT cryptography
#
# # retry a couple of times, appstore needs some time
# for i in {1..100};
# do
# build_id=$(./scripts/ci/appstore_connect.py --key_id ${{ secrets.IOS_APPSTORE_KEY_ID }} --issuer_id ${{ secrets.IOS_APPSTORE_ISSUER_ID }} --private_key "${{ secrets.IOS_APPSTORE_PRIVATE_KEY }}" build_id_by_version ${APK_VERSION_CODE}) &&
# break ||
# sleep 15;
# done
# public_testers_id="7bca90ae-e44b-4d20-bf71-17a8dced5a01"
# ./scripts/ci/appstore_connect.py --key_id ${{ secrets.IOS_APPSTORE_KEY_ID }} --issuer_id ${{ secrets.IOS_APPSTORE_ISSUER_ID }} --private_key "${{ secrets.IOS_APPSTORE_PRIVATE_KEY }}" add_to_beta_group ${public_testers_id} ${build_id}
- name: π Upload Release Asset
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}.ipa
asset_name: qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}-${{ env.TRIPLET }}-${{ env.DEPLOYMENT_TARGET }}.ipa
asset_content_type: application/zip
- name: Upload debug symbols
# if: release or labeled PR
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: |
curl -sL https://sentry.io/get-cli/ | bash
sentry-cli upload-dif -o opengisch -p qfield /Users/runner/builddir