-
Notifications
You must be signed in to change notification settings - Fork 2.2k
224 lines (224 loc) · 10 KB
/
master-push.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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
name: Prepare Release
on:
push:
branches:
- "dp/migration_release_pipeline"
jobs:
prepare:
runs-on: ubuntu-latest
name: Create Draft Release to store artifacts
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Export GITHUB_TOKEN to workspace
run: echo "GITHUB_ACCESS_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Install ruby
uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
with:
ruby-version: '3.1.2'
- name: Install Gems
run: |
gem install octokit
- name: Create draft release to store artifacts.
run: ruby ./scripts/github_release.rb create-draft-release
build-docs:
runs-on: ubuntu-latest
name: Package docs and upload them to the draft release
needs: prepare
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Token
id: token
uses: yuki0n0/[email protected]
with:
# UUID. Can get from App Store Connect.
issuer id: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }}
# Key ID. Can get from App Store Connect.
key id: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }}
# P8 private key. Can get from App Store Connect.
key: ${{ secrets.APPLE_STORE_CONNECT_API_KEY }}
- name: Run release_package-docs xcode cloud build and wait for it to finish, this xcode cloud upload realm-docs.zip assets to the artifacts draft release
run: |
XCODE_VERSION="$(ruby ./scripts/release-matrix.rb docs_version)"
ruby ./scripts/xcode_cloud_helper.rb --run-release-workflow "release_package-docs_${XCODE_VERSION}" --token ${{ steps.token.outputs.token }}
build-examples:
runs-on: macos-latest
name: Package examples and upload them to the draft release
needs: prepare
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Export GITHUB_TOKEN to workspace
run: echo "GITHUB_ACCESS_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Install ruby
uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
with:
ruby-version: '3.1.2'
- name: Install Gems
run: |
gem install octokit
gem install xcodeproj
- name: Run release_package-examples package and uploads the example folder
run: ./build.sh release_package-examples
build-product:
runs-on: ubuntu-latest
name: Package product for each xcode version.
needs: build-examples
strategy:
matrix:
xcode-version: ['14.1', '14.2', '14.3.1', '15.0.1', '15.1']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Token
id: token
uses: yuki0n0/[email protected]
with:
# UUID. Can get from App Store Connect.
issuer id: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }}
# Key ID. Can get from App Store Connect.
key id: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }}
# P8 private key. Can get from App Store Connect.
key: ${{ secrets.APPLE_STORE_CONNECT_API_KEY }}
- name: Run release_package_${{ matrix.xcode-version }} which upload the package to the draft release and wait for it to complete or fail
run: ruby ./scripts/xcode_cloud_helper.rb --run-release-workflow "release_package_${{ matrix.xcode-version }}" --token ${{ steps.token.outputs.token }}
build-package:
runs-on: macos-latest
name: Package products for all xcode version into a single package.
needs: build-product
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Export GITHUB_TOKEN to workspace
run: echo "GITHUB_ACCESS_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name:
run: ./build.sh release-package-all
test-package-examples:
runs-on: ubuntu-latest
name: Test examples, using the packages releases
needs: build-package
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Token
id: token
uses: yuki0n0/[email protected]
with:
# UUID. Can get from App Store Connect.
issuer id: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }}
# Key ID. Can get from App Store Connect.
key id: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }}
# P8 private key. Can get from App Store Connect.
key: ${{ secrets.APPLE_STORE_CONNECT_API_KEY }}
- name: Run release_test-package-examples_15.1 which runs test over the packages produces by the previous step and wait for it to complete or fail
run: ruby ./scripts/xcode_cloud_helper.rb --run-release-workflow release_test-package-examples_15.1 --token ${{ steps.token.outputs.token }}
test-ios-static:
runs-on: ubuntu-latest
name: Run tests on iOS with configuration Static
needs: build-package
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Token
id: token
uses: yuki0n0/[email protected]
with:
# UUID. Can get from App Store Connect.
issuer id: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }}
# Key ID. Can get from App Store Connect.
key id: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }}
# P8 private key. Can get from App Store Connect.
key: ${{ secrets.APPLE_STORE_CONNECT_API_KEY }}
- name: Run release_ios-static_15.1 which runs test over the packages produces by the previous step and wait for it to complete or fail
run: ruby ./scripts/xcode_cloud_helper.rb --run-release-workflow release_test-ios-static_15.1 --token ${{ steps.token.outputs.token }}
test-osx-static:
runs-on: ubuntu-latest
name: Run tests on macOS
needs: build-package
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Token
id: token
uses: yuki0n0/[email protected]
with:
# UUID. Can get from App Store Connect.
issuer id: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }}
# Key ID. Can get from App Store Connect.
key id: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }}
# P8 private key. Can get from App Store Connect.
key: ${{ secrets.APPLE_STORE_CONNECT_API_KEY }}
- name: Run release_osx_15.1 which runs test over the packages produces by the previous step and wait for it to complete or fail
run: ruby ./scripts/xcode_cloud_helper.rb --run-release-workflow release_test-osx_15.1 --token ${{ steps.token.outputs.token }}
test-installation:
runs-on: ubuntu-latest
name: Run installation test for ${{ matrix.platform }}, ${{ matrix.installation }} and ${{ matrix.linkage }}
needs: build-package
env:
XCODE_VERSION: '14.3.1'
strategy:
matrix:
platform: [ios, osx, watchos, tvos, catalyst]
installation: [cocoapods, spm, carthage, xcframework]
linkage: [static, dynamic]
exclude:
- platform: catalyst
installation: carthage
- installation: carthage
linkage: static
- platform: osx
installation: xcframework
linkage: static
- platform: watchos
installation: xcframework
linkage: static
- platform: tvos
installation: xcframework
linkage: static
- platform: catalyst
installation: xcframework
linkage: static
- platform: osx
installation: xcframework
linkage: dynamic
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Token
id: token
uses: yuki0n0/[email protected]
with:
# UUID. Can get from App Store Connect.
issuer id: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }}
# Key ID. Can get from App Store Connect.
key id: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }}
# P8 private key. Can get from App Store Connect.
key: ${{ secrets.APPLE_STORE_CONNECT_API_KEY }}
- name: Creates an XCode Cloud workflow to run the test and runs build
run: |
ruby ./scripts/xcode_cloud_helper.rb --create-release-workflow-and-run test-installation-${{ matrix.platform }}-${{ matrix.installation }}-${{ matrix.linkage }} --xcode-version "$XCODE_VERSION" --token ${{ steps.token.outputs.token }} --team-id ${{ secrets.APPLE_STORE_CONNECT_TEAM_ID }}
test-installation-xcode:
runs-on: ubuntu-latest
name: Run installation test on macOS only for for xcframework for all ${{ matrix.xcode_version }}
needs: build-package
strategy:
max-parallel: 5
matrix:
xcode_version: ['14.1', '14.2', '14.3.1', '15.0.1', '15.1']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Token
id: token
uses: yuki0n0/[email protected]
with:
# UUID. Can get from App Store Connect.
issuer id: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }}
# Key ID. Can get from App Store Connect.
key id: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }}
# P8 private key. Can get from App Store Connect.
key: ${{ secrets.APPLE_STORE_CONNECT_API_KEY }}
- name: Run installation tests for osx xcframework dynamic in xcode version ${{ matrix.xcode-version }}
run: |
ruby ./scripts/xcode_cloud_helper.rb --run-release-workflow "release_test-installation-osx-xcframework-dynamic_${{ matrix.xcode-version }}" --token ${{ steps.token.outputs.token }}