-
-
Notifications
You must be signed in to change notification settings - Fork 228
193 lines (170 loc) ยท 6.79 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
---
name: ๐ iOS
on:
push:
branches:
- master
- release-**
pull_request:
release:
types: ['published']
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
jobs:
build:
name: build (ios)
runs-on: macos-14
env:
DEPLOYMENT_TARGET: '14.0'
BUILD_TYPE: 'Release'
TRIPLET: 'arm64-ios'
steps:
- name: ๐ฃ Checkout
uses: actions/checkout@v4
if: ${{ env.SENTRY_AUTH_TOKEN != '' }}
with:
submodules: recursive
- name: Reclaim disk space
if: ${{ env.SENTRY_AUTH_TOKEN != '' }}
run: |
rm -rf /Applications/Xcode_14*
rm -rf /Applications/Xcode_16*
rm -rf /Users/runner/Library/Android/sdk
- name: ๐พ Prepare variables
id: vars
if: ${{ env.SENTRY_AUTH_TOKEN != '' }}
run: |
./scripts/ci/env_gh.sh
- name: โ๏ธ Setup SSH
uses: webfactory/[email protected]
if: ${{ env.SENTRY_AUTH_TOKEN != '' }}
with:
ssh-private-key: ${{ secrets.SSH_KEY_DEPLOYMENT_CERTIFICATES }}
- name: ๐ Setup ruby
uses: ruby/setup-ruby@v1
if: ${{ env.SENTRY_AUTH_TOKEN != '' }}
with:
ruby-version: '3.2' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: ๐ Setup code signing
if: ${{ env.SENTRY_AUTH_TOKEN != '' }}
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
run: |
bundle exec fastlane ios setup_signing type:${{ env.IOS_SIGN_TYPE }} app_identifier:${{ env.IOS_APP_IDENTIFIER }} # --verbose
- name: ๐น Prepare ios build env
if: ${{ env.SENTRY_AUTH_TOKEN != '' }}
run: |
# Workaround GitHub Actions Python issues
brew unlink python && brew link --overwrite python
brew install automake bison flex gnu-sed s3cmd gettext autoconf-archive nasm libtool
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
echo $(brew --prefix autoconf-archive)/bin >> $GITHUB_PATH
echo $(brew --prefix libtool)/bin >> $GITHUB_PATH
- name: ๐ฉ Install CMake and Ninja
uses: lukka/get-cmake@latest
if: ${{ env.SENTRY_AUTH_TOKEN != '' }}
with:
cmakeVersion: 3.29.0
- name: ๐ Setup Python
uses: actions/setup-python@v5
if: ${{ env.SENTRY_AUTH_TOKEN != '' }}
with:
python-version: '3.11'
- name: ๐ญ Setup XCode
uses: maxim-lobanov/[email protected]
if: ${{ env.SENTRY_AUTH_TOKEN != '' }}
with:
xcode-version: latest-stable
- name: ๐ฎ ccache
uses: hendrikmuhs/[email protected]
if: ${{ env.SENTRY_AUTH_TOKEN != '' }}
with:
key: ccache-ios
max-size: 200M
- name: ๐ฑ Install dependencies and generate project files
if: ${{ env.SENTRY_AUTH_TOKEN != '' }}
run: |
source ./scripts/version_number.sh
source ./scripts/ci/generate-version-details.sh
cmake -S "${{ github.workspace }}" \
-B "/Users/runner/builddir" \
-G "Xcode" \
-D CMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-D VCPKG_TARGET_TRIPLET="${{ env.TRIPLET }}" \
-D VCPKG_HOST_TRIPLET="arm64-osx" \
-D WITH_VCPKG=ON \
-D WITH_SPIX=OFF \
-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.IOS_CODE_SIGN_IDENTITY }}" \
-D QT_IOS_PROVISIONING_PROFILE_SPECIFIER="${{ env.IOS_PROVISIONING_PROFILE_SPECIFIER }}" \
-D QT_IOS_EXPORT_METHOD="${{ env.IOS_EXPORT_METHOD }}" \
-D IOS_APP_IDENTIFIER="${{ env.IOS_APP_IDENTIFIER }}" \
-D CMAKE_SYSTEM_NAME=iOS \
-D CMAKE_SYSTEM_PROCESSOR=aarch64 \
-D CMAKE_OSX_DEPLOYMENT_TARGET=${{ env.DEPLOYMENT_TARGET }} \
-D ENABLE_TESTS=OFF \
-D CMAKE_CXX_VISIBILITY_PRESET=hidden \
-D WITH_CCACHE=ON
- name: ๐ Upload Dep Build Logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: build-logs-${{ env.TRIPLET }}
path: |
/Users/runner/builddir/**/*.log
- name: ๐ฆ Package
if: ${{ env.SENTRY_AUTH_TOKEN != '' }}
run: |
cmake --build /Users/runner/builddir --target bundle --config Release
- name: ๐บ Deploy
if: ${{ env.SENTRY_AUTH_TOKEN != '' }}
env:
S3_BUCKET: qfieldapks
S3_REGION: ch-dk-2
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY}}
S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY}}
run: |
bundle exec fastlane ios upload_s3 ipa:/Users/runner/builddir/qfieldIpa/QField.ipa
- name: ๐ค Upload qfield Ipa
uses: actions/upload-artifact@v4
if: ${{ env.SENTRY_AUTH_TOKEN != '' }}
with:
name: qfield-${{ env.TRIPLET }}-${{ env.DEPLOYMENT_TARGET }}.ipa
path: /Users/runner/builddir/qfieldIpa/QField.ipa
- name: ๐ Release to TestFlight
if: ${{ env.CI_TAG }}
env:
issuer_id: ${{ secrets.IOS_APPSTORE_ISSUER_ID }}
api_key_id: ${{ secrets.IOS_APPSTORE_KEY_ID }}
api_private_key: ${{ secrets.IOS_APPSTORE_PRIVATE_KEY }}
run: |
bundle exec fastlane ios upload_testflight ipa:/Users/runner/builddir/qfieldIpa/QField.ipa
- name: ๐ฎ Upload debug symbols
if: ${{ env.SENTRY_AUTH_TOKEN != '' }}
# if: release or labeled PR
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG_SLUG: opengisch
SENTRY_PROJECT_SLUG: qfield
run: |
bundle exec fastlane run sentry_debug_files_upload path:/Users/runner/builddir