Skip to content

Commit 06a8f88

Browse files
authored
Move Xcode 16 jobs to the macos-15 runner (#8695)
Xcode 16 will be removed from macos-14 to cut down on the image size: actions/runner-images#10703
1 parent 2f7bd40 commit 06a8f88

File tree

3 files changed

+67
-297
lines changed

3 files changed

+67
-297
lines changed

.github/workflows/master-push.yml

Lines changed: 57 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ on:
66
- "master"
77
- "release/**"
88
env:
9-
XCODE_VERSION: "['15.3', '15.4', '16', '16.1_beta_2']"
9+
XCODE_VERSION: "['15.3', '15.4', '16', '16.1_beta_3']"
1010
PLATFORM: "['ios', 'osx', 'watchos', 'tvos', 'catalyst', 'visionos']"
11-
DOC_VERSION: '15.4'
1211
RELEASE_VERSION: '15.4'
12+
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
1313
jobs:
1414
prepare:
1515
runs-on: ubuntu-latest
@@ -38,8 +38,6 @@ jobs:
3838
- uses: ruby/setup-ruby@v1
3939
with:
4040
bundler-cache: true
41-
- name: Select Xcode Version
42-
run: sudo xcode-select -switch /Applications/Xcode_${{ env.DOC_VERSION }}.app
4341
- name: Prepare docs for packaging
4442
run: bundle exec sh -x build.sh release-package-docs
4543
- name: Upload docs to artifacts library
@@ -61,15 +59,27 @@ jobs:
6159
name: realm-examples
6260
path: realm-examples.zip
6361
build-product: # Creates framework for each platform, xcode version, target and configuration
64-
runs-on: macos-14
6562
name: Package framework
6663
needs: prepare
6764
strategy:
68-
max-parallel: 20 # Blocks of 20, therefore if any of the build fails, we don't get a lot of XCode Clouds builds hanging, which are expensive.
65+
max-parallel: 20
6966
matrix:
7067
platform: ${{ fromJSON(needs.prepare.outputs.PLATFORM_MATRIX) }}
7168
xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }}
7269
configuration: [swift, static]
70+
include:
71+
- xcode-version: 15.3
72+
xcode-version-tag: 15.3
73+
os: macos-14
74+
- xcode-version: 15.4
75+
xcode-version-tag: 15.4
76+
os: macos-14
77+
- xcode-version: 16
78+
xcode-version-tag: '16.0'
79+
os: macos-15
80+
- xcode-version: 16.1_beta_3
81+
xcode-version-tag: 16.1
82+
os: macos-15
7383
exclude:
7484
- platform: osx
7585
configuration: static
@@ -81,79 +91,39 @@ jobs:
8191
configuration: static
8292
- platform: catalyst
8393
configuration: static
84-
- platform: visionos
85-
xcode-version: 15.1
94+
runs-on: ${{ matrix.os }}
95+
env:
96+
DEVELOPER_DIR: /Applications/Xcode_${{matrix.xcode-version}}.app/Contents/Developer
8697
steps:
8798
- uses: actions/checkout@v4
88-
- name: Build ${{ matrix.platform }} with Xcode ${{ matrix.xcode-version }}
89-
run: DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode-version }}.app/Contents/Developer sh build.sh ${{ matrix.platform }}-${{matrix.configuration}}
90-
- run: rm -r build/DerivedData
99+
- name: Download visionOS
100+
if: matrix.platform == 'visionos' && matrix.os == 'macos-14'
101+
run: xcodebuild -downloadPlatform visionOS
102+
- run: sh build.sh ${{matrix.platform}}-${{matrix.configuration}}
103+
- run: tar cf build.tar build/*/${{matrix.platform}}
91104
- name: Upload framework
92105
uses: actions/upload-artifact@v4
93106
with:
94-
name: build-${{ matrix.platform }}-${{ matrix.xcode-version }}-${{ matrix.configuration }}
95-
path: build
107+
name: build-${{matrix.platform}}-${{matrix.xcode-version-tag}}-${{matrix.configuration}}
108+
path: build.tar
96109
compression-level: 1
97-
package-xcframework-platform: # Creates xcframework for each platform and xcode version
98-
runs-on: macos-14
99-
name: Package xcframework for platform
100-
needs: [build-product, prepare]
101-
strategy:
102-
matrix:
103-
platform: ${{ fromJSON(needs.prepare.outputs.PLATFORM_MATRIX) }}
104-
xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }}
105-
exclude:
106-
- platform: visionos
107-
xcode-version: 15.1
108-
steps:
109-
- uses: actions/checkout@v4
110-
- name: Select Xcode Version
111-
run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app
112-
- name: Install the Apple certificate and provisioning profile
113-
env:
114-
DEVELOPMENT_CERTIFICATE_BASE64: ${{ secrets.DEVELOPMENT_CERTIFICATE_BASE64 }}
115-
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
116-
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
117-
run: |
118-
sh -x build.sh install-apple-certificates
119-
- name: Restore frameworks
120-
uses: actions/download-artifact@v4
121-
with:
122-
pattern: build-${{ matrix.platform }}*-${{ matrix.xcode-version }}-*
123-
- name: Create xcframework
124-
env:
125-
SIGNING_IDENTITY: ${{ secrets.SIGNING_IDENTITY }}
126-
run: |
127-
sh -x build.sh release-create-xcframework-${{ matrix.xcode-version }} ${{ matrix.platform }}
128-
- name: Upload xcframework
129-
uses: actions/upload-artifact@v4
130-
with:
131-
name: realm-${{ matrix.platform }}-${{ matrix.xcode-version }}
132-
path: realm-${{ matrix.platform }}-${{ matrix.xcode-version }}.zip
133-
package-release: # Creates xcframework for each platform and xcode version
110+
package-release:
134111
runs-on: macos-14
135112
name: Package release file
136-
needs: [package-xcframework-platform, prepare]
113+
needs: [build-product, prepare]
137114
steps:
138115
- uses: actions/checkout@v4
139-
- name: Select Xcode Version
140-
run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app
116+
- uses: actions/download-artifact@v4
141117
- name: Install the Apple certificate and provisioning profile
142118
env:
143119
DEVELOPMENT_CERTIFICATE_BASE64: ${{ secrets.DEVELOPMENT_CERTIFICATE_BASE64 }}
144120
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
145121
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
146-
run: |
147-
sh -x build.sh install-apple-certificates
148-
- name: Restore packages xcframeworks
149-
uses: actions/download-artifact@v4
150-
with:
151-
pattern: realm-*
122+
run: sh build.sh install-apple-certificates
152123
- name: Create release
153124
env:
154125
SIGNING_IDENTITY: ${{ secrets.SIGNING_IDENTITY }}
155-
run: |
156-
sh -x build.sh release-package
126+
run: sh -x build.sh release-package
157127
- name: Upload release artifactss
158128
uses: actions/upload-artifact@v4
159129
with:
@@ -162,20 +132,18 @@ jobs:
162132
- name: Upload release for testing
163133
uses: actions/upload-artifact@v4
164134
with:
165-
name: realm-swift-${{ needs.prepare.outputs.VERSION }}
135+
name: test-release-package
166136
path: pkg/realm-swift-${{ needs.prepare.outputs.VERSION }}.zip
167137
test-package-examples:
168138
runs-on: macos-14
169139
name: Test examples
170140
needs: [package-release, prepare]
171141
steps:
172142
- uses: actions/checkout@v4
173-
- name: Select Xcode Version
174-
run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app
175143
- name: Restore release
176144
uses: actions/download-artifact@v4
177145
with:
178-
name: realm-swift-${{ needs.prepare.outputs.VERSION }}
146+
name: test-release-package
179147
- name: Test examples
180148
run: sh -x build.sh release-test-examples
181149
test-ios-static:
@@ -184,8 +152,6 @@ jobs:
184152
needs: package-release
185153
steps:
186154
- uses: actions/checkout@v4
187-
- name: Select Xcode Version
188-
run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app
189155
- name: Test ios static
190156
run: sh -x build.sh test-ios-static
191157
test-osx-static:
@@ -194,8 +160,6 @@ jobs:
194160
needs: package-release
195161
steps:
196162
- uses: actions/checkout@v4
197-
- name: Select Xcode Version
198-
run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app
199163
- name: Test osx static
200164
run: |
201165
export REALM_DISABLE_METADATA_ENCRYPTION=1
@@ -204,19 +168,19 @@ jobs:
204168
runs-on: macos-14
205169
name: Run installation test
206170
needs: [package-release, prepare]
171+
env:
172+
REALM_TEST_BRANCH: "${{github.ref_name}}"
207173
strategy:
208174
matrix:
209175
platform: ${{ fromJSON(needs.prepare.outputs.PLATFORM_MATRIX) }}
210-
installation: [cocoapods, spm, carthage, xcframework]
176+
installation: [cocoapods, spm, carthage]
211177
linkage: [dynamic, static]
212178
exclude:
213179
- platform: visionos
214180
- platform: catalyst
215181
installation: carthage
216182
- installation: carthage
217183
linkage: static
218-
- installation: xcframework
219-
linkage: static
220184
include:
221185
- platform: ios
222186
installation: xcframework
@@ -226,50 +190,51 @@ jobs:
226190
- uses: ruby/setup-ruby@v1
227191
with:
228192
bundler-cache: true
229-
- name: Select Xcode Version
230-
run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app
193+
- name: Download visionOS
194+
if: matrix.platform == 'visionos' && matrix.os == 'macos-14'
195+
run: xcodebuild -downloadPlatform visionOS
231196
- name: Restore release
232197
uses: actions/download-artifact@v4
233198
if: ${{ matrix.installation == 'xcframework' }}
234199
with:
235-
name: realm-${{ matrix.platform }}-${{ env.RELEASE_VERSION }}
236-
- name: Unzip package release
237-
if: ${{ matrix.installation == 'xcframework' }}
238-
run: |
239-
mkdir -p build
240-
unzip realm-${{ matrix.platform }}-${{ env.RELEASE_VERSION }}.zip -d build
200+
name: test-release-package
241201
- name: Run installation test
242202
run: |
243-
echo "REALM_TEST_BRANCH=${{ github.ref_name }}" >> $GITHUB_OUTPUT
203+
find . -name '*.zip' -depth 1 -exec mv {} examples/installation \;
244204
cd examples/installation
245205
bundle exec ./build.rb ${{ matrix.platform }} ${{ matrix.installation }} ${{ matrix.linkage }}
246206
test-installation-xcframework:
247-
runs-on: macos-14
248207
name: Run installation test for xcframework
249208
needs: [package-release, prepare]
250-
env:
251-
PLATFORM: 'osx'
252209
strategy:
253210
matrix:
254211
xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }}
212+
include:
213+
- xcode-version: 15.3
214+
os: macos-14
215+
- xcode-version: 15.4
216+
os: macos-14
217+
- xcode-version: 16
218+
os: macos-15
219+
- xcode-version: 16.1_beta_3
220+
os: macos-15
221+
env:
222+
PLATFORM: 'osx'
223+
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode-version }}.app/Contents/Developer
224+
REALM_TEST_BRANCH: "${{github.ref_name}}"
225+
runs-on: ${{ matrix.os }}
255226
steps:
256227
- uses: actions/checkout@v4
257228
- uses: ruby/setup-ruby@v1
258229
with:
259230
bundler-cache: true
260-
- name: Select Xcode Version
261-
run: sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode-version }}.app
262231
- name: Restore release
263232
uses: actions/download-artifact@v4
264233
with:
265-
name: realm-${{ env.PLATFORM }}-${{ matrix.xcode-version }}
266-
- name: Unzip package release
267-
run: |
268-
mkdir -p build
269-
unzip realm-${{ env.PLATFORM }}-${{ matrix.xcode-version }}.zip -d build
234+
name: test-release-package
270235
- name: Run installation test
271236
run: |
272-
echo "REALM_TEST_BRANCH=${{ github.ref_name }}" >> $GITHUB_OUTPUT
237+
find . -name '*.zip' -depth 1 -exec mv {} examples/installation \;
273238
cd examples/installation
274239
bundle exec ./build.rb osx xcframework dynamic
275240

0 commit comments

Comments
 (0)