@@ -46,11 +46,29 @@ jobs:
4646 token : ${{ github.token }}
4747 filters : .github/file-filters.yml
4848
49+ setup-matrix :
50+ runs-on : ubuntu-latest
51+ if : github.event_name != 'pull_request' || needs.files-changed.outputs.run_release_for_prs == 'true'
52+ needs : files-changed
53+ steps :
54+ - uses : actions/checkout@v4
55+ - name : Setup matrix combinations
56+ id : setup-matrix-combinations
57+ run : |
58+ ./scripts/generate_release_matrix.sh
59+ env :
60+ EVENT_NAME : ${{ github.event_name }}
61+ outputs :
62+ slices : ${{ steps.setup-matrix-combinations.outputs.slices }}
63+ variants : ${{ steps.setup-matrix-combinations.outputs.variants }}
64+ sdk-list-array : ${{ steps.setup-matrix-combinations.outputs.sdk-list-array }}
65+ sdk-list-string : ${{ steps.setup-matrix-combinations.outputs.sdk-list-string }}
66+
4967 build-xcframework-variant-slices :
5068 name : Build XCFramework Slices
5169 # Run the job only for PRs with related changes or non-PR events.
5270 if : github.event_name != 'pull_request' || needs.files-changed.outputs.run_release_for_prs == 'true'
53- needs : files-changed
71+ needs : [ files-changed, setup-matrix]
5472 uses : ./.github/workflows/build-xcframework-variant-slices.yml
5573 with :
5674 name : ${{matrix.variant.name}}
@@ -59,27 +77,13 @@ jobs:
5977 configuration-suffix : ${{matrix.variant.configuration-suffix}}
6078 variant-id : ${{matrix.variant.id}}
6179 release-version : ${{ github.event.inputs.version }}
80+ sdk-list : ${{ needs.setup-matrix.outputs.sdk-list-array }}
6281 strategy :
6382 matrix :
64- variant :
65- - name : Sentry
66- macho-type : mh_dylib
67- suffix : " -Dynamic"
68- id : sentry-dynamic
69- - name : Sentry
70- macho-type : staticlib
71- id : sentry-static
72- - name : SentrySwiftUI
73- macho-type : mh_dylib
74- id : sentry-swiftui
75- - name : Sentry
76- macho-type : mh_dylib
77- suffix : " -WithoutUIKitOrAppKit"
78- configuration-suffix : WithoutUIKit
79- id : sentry-withoutuikit-dynamic
83+ variant : ${{ fromJson(needs.setup-matrix.outputs.slices) }}
8084
8185 assemble-xcframework-variant :
82- needs : [files-changed, build-xcframework-variant-slices]
86+ needs : [files-changed, build-xcframework-variant-slices, setup-matrix ]
8387 # Run the job only for PRs with related changes or non-PR events.
8488 if : github.event_name != 'pull_request' || needs.files-changed.outputs.run_release_for_prs == 'true'
8589 name : Assemble XCFramework Variant
@@ -94,37 +98,10 @@ jobs:
9498 release-version : ${{ github.event.inputs.version }}
9599 excluded-archs : ${{matrix.variant.excluded-archs}}
96100 override-name : ${{matrix.variant.override-name}}
101+ sdks : ${{ needs.setup-matrix.outputs.sdk-list-string }}
97102 strategy :
98103 matrix :
99- variant :
100- - scheme : Sentry
101- macho-type : mh_dylib
102- suffix : " -Dynamic"
103- id : sentry-dynamic
104- excluded-archs : arm64e
105- - scheme : Sentry
106- macho-type : mh_dylib
107- suffix : " -Dynamic"
108- id : sentry-dynamic
109- override-name : Sentry-Dynamic-WithARM64e
110- - scheme : Sentry
111- macho-type : staticlib
112- id : sentry-static
113- - scheme : SentrySwiftUI
114- macho-type : mh_dylib
115- id : sentry-swiftui
116- - scheme : Sentry
117- macho-type : mh_dylib
118- suffix : " -WithoutUIKitOrAppKit"
119- configuration-suffix : WithoutUIKit
120- id : sentry-withoutuikit-dynamic
121- excluded-archs : arm64e
122- - scheme : Sentry
123- macho-type : mh_dylib
124- suffix : " -WithoutUIKitOrAppKit"
125- configuration-suffix : WithoutUIKit
126- id : sentry-withoutuikit-dynamic
127- override-name : Sentry-WithoutUIKitOrAppKit-WithARM64e
104+ variant : ${{ fromJson(needs.setup-matrix.outputs.variants) }}
128105
129106 validate-xcframework :
130107 name : Validate XCFramework
@@ -163,16 +140,11 @@ jobs:
163140 with :
164141 pattern : xcframework-${{github.sha}}-*
165142 merge-multiple : true
166- - name : Remove newer package files
167- if : ${{ matrix.package-file.name == 'Package.swift' }}
168- run : rm -rf Package@swift*
169- - name : Change path of the framework
170- run : |
171- sed -i '' 's/url.*//g' ${{matrix.package-file.name}}
172- sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' ${{matrix.package-file.name}}
173- sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic-WithARM64e/path: "Sentry-Dynamic-WithARM64e.xcframework.zip"/g' ${{matrix.package-file.name}}
174- sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' ${{matrix.package-file.name}}
175- shell : bash
143+ - name : Prepare Package.swift
144+ uses : ./.github/actions/prepare-package.swift
145+ with :
146+ is-pr : ${{ github.event_name == 'pull_request' }}
147+ package-file : ${{matrix.package-file.name}}
176148 - run : swift build
177149 working-directory : Samples/macOS-SPM-CommandLine
178150 - name : Run CI Diagnostics
@@ -196,16 +168,11 @@ jobs:
196168 with :
197169 pattern : xcframework-${{github.sha}}-*
198170 merge-multiple : true
199- - name : Remove newer package files
200- if : ${{ matrix.package-file.name == 'Package.swift' }}
201- run : rm -rf Package@swift*
202- - name : Change path of the framework
203- run : |
204- sed -i '' 's/url.*//g' ${{matrix.package-file.name}}
205- sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' ${{matrix.package-file.name}}
206- sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic-WithARM64e/path: "Sentry-Dynamic-WithARM64e.xcframework.zip"/g' ${{matrix.package-file.name}}
207- sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' ${{matrix.package-file.name}}
208- shell : bash
171+ - name : Prepare Package.swift
172+ uses : ./.github/actions/prepare-package.swift
173+ with :
174+ is-pr : ${{ github.event_name == 'pull_request' }}
175+ package-file : ${{matrix.package-file.name}}
209176 - run : swift build
210177 working-directory : Samples/SPM-Dynamic
211178 - name : Run CI Diagnostics
@@ -229,16 +196,11 @@ jobs:
229196 with :
230197 pattern : xcframework-${{github.sha}}-*
231198 merge-multiple : true
232- - name : Remove newer package files
233- if : ${{ matrix.package-file.name == 'Package.swift' }}
234- run : rm -rf Package@swift*
235- - name : Change path of the framework
236- run : |
237- sed -i '' 's/url.*//g' ${{matrix.package-file.name}}
238- sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' ${{matrix.package-file.name}}
239- sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic-WithARM64e/path: "Sentry-Dynamic-WithARM64e.xcframework.zip"/g' ${{matrix.package-file.name}}
240- sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' ${{matrix.package-file.name}}
241- shell : bash
199+ - name : Prepare Package.swift
200+ uses : ./.github/actions/prepare-package.swift
201+ with :
202+ is-pr : ${{ github.event_name == 'pull_request' }}
203+ package-file : ${{matrix.package-file.name}}
242204 - run : swift build
243205 - name : Run CI Diagnostics
244206 if : failure()
0 commit comments