Skip to content

Commit 55466ae

Browse files
committed
Preserve symlinks when creating the release package
actions/upload-artifact follows symlinks when asked to archive a directory, which results in the release package having three copies of each macos/catalyst library. To fix this, skip extracting the zip before archiving even though it results in an awkward nested zip.
1 parent 68530d3 commit 55466ae

File tree

3 files changed

+73
-183
lines changed

3 files changed

+73
-183
lines changed

.github/workflows/master-push.yml

Lines changed: 18 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ on:
33
push:
44
branches:
55
- "master"
6+
- "tg/release-symlink"
67
env:
78
XCODE_VERSION: "['14.2', '14.3.1', '15.1', '15.2']"
89
PLATFORM: "['ios', 'osx', 'watchos', 'tvos', 'catalyst', 'visionos']"
910
BUILD_PLATFORM: "['ios', 'iossimulator', 'osx', 'watchos', 'watchossimulator', 'tvos', 'tvossimulator', 'catalyst', 'visionos', 'visionossimulator']"
10-
DOC_VERSION: '15.1'
11+
DOC_VERSION: '15.2'
1112
JAZZY_VERSION: '0.14.4'
1213
RELEASE_VERSION: '15.2'
13-
TEST_VERSION: '15.1'
14+
TEST_VERSION: '15.2'
1415
jobs:
1516
cleanup: # Clean-up XCode cloud workflows, before running the pipeline
1617
runs-on: ubuntu-latest
@@ -21,7 +22,7 @@ jobs:
2122
id: token
2223
run: |
2324
token=$(echo $(ruby ./scripts/xcode_cloud_helper.rb --issuer-id ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }} --key-id ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} --pk "${{ secrets.APPLE_STORE_CONNECT_API_KEY }}" get-token))
24-
echo "TOKEN=$token" >> $GITHUB_OUTPUT
25+
echo "TOKEN=$token" >> $GITHUB_OUTPUT
2526
- name: Clean up release-packages xcode cloud workflows
2627
run: |
2728
ruby ./scripts/xcode_cloud_helper.rb clean-up-release-workflows -t ${{ steps.token.outputs.TOKEN }}
@@ -81,13 +82,12 @@ jobs:
8182
name: realm-examples
8283
build-product: # Creates framework for each platform, xcode version, target and configuration
8384
runs-on: macos-13
84-
name: Package framework
85+
name: Package framework
8586
needs: prepare
8687
strategy:
8788
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.
8889
matrix:
8990
platform: ${{ fromJSON(needs.prepare.outputs.BUILD_PLATFORM_MATRIX) }}
90-
target: [RealmSwift, Realm]
9191
xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }}
9292
configuration: [release, static]
9393
exclude:
@@ -107,8 +107,6 @@ jobs:
107107
configuration: static
108108
- platform: visionossimulator
109109
configuration: static
110-
- target: RealmSwift
111-
configuration: static
112110
- platform: visionos
113111
xcode-version: 14.2
114112
- platform: visionossimulator
@@ -136,21 +134,21 @@ jobs:
136134
timeout_minutes: 10
137135
max_attempts: 3
138136
command: |
139-
workflow_id=$(ruby ./scripts/xcode_cloud_helper.rb create-workflow release-package-build ${{ matrix.platform }} ${{ matrix.xcode-version }} ${{ matrix.target }} ${{ matrix.configuration }} -t ${{ steps.token.outputs.TOKEN }})
137+
workflow_id=$(ruby ./scripts/xcode_cloud_helper.rb create-workflow release-package-build ${{ matrix.platform }} ${{ matrix.xcode-version }} RealmSwift ${{ matrix.configuration }} -t ${{ steps.token.outputs.TOKEN }})
140138
echo "WORKFLOW_ID=$workflow_id" >> $GITHUB_OUTPUT
141139
- name: Runs the XCode Cloud workflow created by the previous step
142140
id: build-run
143141
uses: nick-fields/retry@v2
144142
with:
145-
timeout_minutes: 10
143+
timeout_minutes: 15
146144
max_attempts: 3
147145
command: |
148146
build_run_id=$(ruby ./scripts/xcode_cloud_helper.rb build-workflow ${{ steps.create-workflow.outputs.WORKFLOW_ID }} ${{ github.ref_name }} -t ${{ steps.token.outputs.TOKEN }})
149147
echo "BUILD_RUN_ID=$build_run_id" >> $GITHUB_OUTPUT
150148
- name: Check build status and wait for it to finish
151149
uses: nick-fields/retry@v2
152150
with:
153-
timeout_minutes: 10
151+
timeout_minutes: 15
154152
max_attempts: 3
155153
command: |
156154
while [ "$status" != 'COMPLETE' ]
@@ -176,76 +174,12 @@ jobs:
176174
command: |
177175
token=$(ruby ./scripts/xcode_cloud_helper.rb --issuer-id ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }} --key-id ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} --pk "${{ secrets.APPLE_STORE_CONNECT_API_KEY }}" get-token)
178176
ruby ./scripts/xcode_cloud_helper.rb download-artifact ${{ steps.build-run.outputs.BUILD_RUN_ID }} -t $token
179-
- name: Prepare product folder
180-
uses: nick-fields/retry@v2
181-
with:
182-
timeout_minutes: 10
183-
max_attempts: 3
184-
command: |
185-
sh -x build.sh release-package-product
186177
- name: Upload framework
187178
uses: actions/upload-artifact@v4
188179
with:
189-
name: product-${{ matrix.platform }}-${{ matrix.xcode-version }}-${{ matrix.target }}-${{ matrix.configuration }}
190-
path: product-package
191-
# build-product: # Creates framework for each platform, xcode version, target and configuration
192-
# runs-on: macos-13
193-
# name: Package framework
194-
# needs: prepare
195-
# strategy:
196-
# matrix:
197-
# platform: ${{ fromJSON(needs.prepare.outputs.BUILD_PLATFORM_MATRIX) }}
198-
# target: [RealmSwift, Realm]
199-
# xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }}
200-
# configuration: [release, static]
201-
# exclude:
202-
# - platform: osx
203-
# configuration: static
204-
# - platform: tvos
205-
# configuration: static
206-
# - platform: watchos
207-
# configuration: static
208-
# - platform: visionos
209-
# configuration: static
210-
# - platform: catalyst
211-
# configuration: static
212-
# - platform: tvossimulator
213-
# configuration: static
214-
# - platform: watchossimulator
215-
# configuration: static
216-
# - platform: visionossimulator
217-
# configuration: static
218-
# - target: RealmSwift
219-
# configuration: static
220-
# - platform: visionos
221-
# xcode-version: 14.2
222-
# - platform: visionossimulator
223-
# xcode-version: 14.2
224-
# - platform: visionos
225-
# xcode-version: 14.3.1
226-
# - platform: visionossimulator
227-
# xcode-version: 14.3.1
228-
# - platform: visionos
229-
# xcode-version: 15.1
230-
# - platform: visionossimulator
231-
# xcode-version: 15.1
232-
# steps:
233-
# - name: Checkout
234-
# uses: actions/checkout@v4
235-
# - name: Select Xcode Version
236-
# run: sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode-version }}.app
237-
# - name: Download visionOS, only for 15.2
238-
# if: ${{ matrix.platform == 'visionos' || matrix.platform == 'visionossimulator' }}
239-
# run: xcodebuild -downloadPlatform visionOS
240-
# - name: Create framework
241-
# run: sh -x build.sh release-package-build_${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.configuration }}
242-
# - name: Prepare product folder
243-
# run: sh -x build.sh release-package-product
244-
# - name: Upload build product
245-
# uses: actions/upload-artifact@v4
246-
# with:
247-
# name: product-${{ matrix.platform }}-${{ matrix.xcode-version }}-${{ matrix.target }}-${{ matrix.configuration }}
248-
# path: product-package
180+
name: build-${{ matrix.platform }}-${{ matrix.xcode-version }}-${{ matrix.configuration }}
181+
path: xcode-cloud-build-${{ steps.build-run.outputs.BUILD_RUN_ID }}.zip
182+
compression-level: 0
249183
package-xcframework-platform: # Creates xcframework for each platform and xcode version
250184
runs-on: macos-13
251185
name: Package xcframework for platform
@@ -254,7 +188,7 @@ jobs:
254188
matrix:
255189
platform: ${{ fromJSON(needs.prepare.outputs.PLATFORM_MATRIX) }}
256190
xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }}
257-
exclude:
191+
exclude:
258192
- platform: visionos
259193
xcode-version: 14.2
260194
- platform: visionos
@@ -269,10 +203,10 @@ jobs:
269203
- name: Restore frameworks
270204
uses: actions/download-artifact@v4
271205
with:
272-
pattern: product-${{ matrix.platform }}*-${{ matrix.xcode-version }}-*
206+
pattern: build-${{ matrix.platform }}*-${{ matrix.xcode-version }}-*
273207
- name: Create xcframework
274-
run: sh -x build.sh release-create-xcframework_${{ matrix.xcode-version }} ${{ matrix.platform }}
275-
- name: Upload xcframework
208+
run: sh -x build.sh release-create-xcframework-${{ matrix.xcode-version }} ${{ matrix.platform }}
209+
- name: Upload xcframework
276210
uses: actions/upload-artifact@v4
277211
with:
278212
name: realm-${{ matrix.platform }}-${{ matrix.xcode-version }}
@@ -301,7 +235,7 @@ jobs:
301235
uses: actions/upload-artifact@v4
302236
with:
303237
name: realm-swift-${{ needs.prepare.outputs.VERSION }}
304-
path: pkg/realm-swift-${{ needs.prepare.outputs.VERSION }}.zip
238+
path: pkg/realm-swift-${{ needs.prepare.outputs.VERSION }}.zip
305239
test-package-examples:
306240
runs-on: macos-13
307241
name: Test examples
@@ -380,7 +314,7 @@ jobs:
380314
mkdir -p build
381315
unzip realm-${{ matrix.platform }}-${{ env.TEST_VERSION }}.zip -d build
382316
- name: Run installation test
383-
run: |
317+
run: |
384318
echo "REALM_TEST_BRANCH=${{ github.ref_name }}" >> $GITHUB_OUTPUT
385319
cd examples/installation
386320
./build.rb ${{ matrix.platform }} ${{ matrix.installation }} ${{ matrix.linkage }}
@@ -413,4 +347,4 @@ jobs:
413347
echo "REALM_TEST_BRANCH=${{ github.ref_name }}" >> $GITHUB_OUTPUT
414348
cd examples/installation
415349
./build.rb osx xcframework dynamic
416-
350+

0 commit comments

Comments
 (0)