1111 - " Sources/**"
1212 - " scripts/ci-select-xcode.sh"
1313 - " scripts/ci-diagnostics.sh"
14+ - " scripts/generate_release_matrix.sh"
1415 - Sentry.xcworkspace/**
1516 - Sentry.xcodeproj/**
1617 - " Package*.swift"
@@ -48,37 +49,43 @@ concurrency:
4849 cancel-in-progress : ${{ github.event_name == 'pull_request' }}
4950
5051jobs :
52+ setup-matrix :
53+ runs-on : ubuntu-latest
54+ steps :
55+ - uses : actions/checkout@v4
56+ - name : Setup matrix combinations
57+ id : setup-matrix-combinations
58+ run : |
59+ ./scripts/generate_release_matrix.sh
60+ env :
61+ EVENT_NAME : ${{ github.event_name }}
62+ outputs :
63+ slices : ${{ steps.setup-matrix-combinations.outputs.slices }}
64+ variants : ${{ steps.setup-matrix-combinations.outputs.variants }}
65+ sdk-list-array : ${{ steps.setup-matrix-combinations.outputs.sdk-list-array }}
66+ sdk-list-string : ${{ steps.setup-matrix-combinations.outputs.sdk-list-string }}
67+
5168 build-xcframework-variant-slices :
5269 name : Build XCFramework Slices
5370 uses : ./.github/workflows/build-xcframework-variant-slices.yml
71+ needs : setup-matrix
5472 with :
5573 name : ${{matrix.variant.name}}
5674 suffix : ${{matrix.variant.suffix}}
5775 macho-type : ${{matrix.variant.macho-type}}
5876 configuration-suffix : ${{matrix.variant.configuration-suffix}}
5977 variant-id : ${{matrix.variant.id}}
6078 release-version : ${{ github.event.inputs.version }}
79+ sdk-list : ${{ needs.setup-matrix.outputs.sdk-list-array }}
6180 strategy :
6281 matrix :
63- variant :
64- - name : Sentry
65- macho-type : mh_dylib
66- suffix : " -Dynamic"
67- id : sentry-dynamic
68- - name : Sentry
69- macho-type : staticlib
70- id : sentry-static
71- - name : SentrySwiftUI
72- macho-type : mh_dylib
73- id : sentry-swiftui
74- - name : Sentry
75- macho-type : mh_dylib
76- suffix : " -WithoutUIKitOrAppKit"
77- configuration-suffix : WithoutUIKit
78- id : sentry-withoutuikit-dynamic
82+ variant : ${{ fromJson(needs.setup-matrix.outputs.slices) }}
7983
8084 assemble-xcframework-variant :
81- needs : build-xcframework-variant-slices
85+ needs : [
86+ " build-xcframework-variant-slices" ,
87+ " setup-matrix" ,
88+ ]
8289 name : Assemble XCFramework Variant
8390 uses : ./.github/workflows/assemble-xcframework-variant.yml
8491 secrets : inherit
@@ -91,37 +98,10 @@ jobs:
9198 release-version : ${{ github.event.inputs.version }}
9299 excluded-archs : ${{matrix.variant.excluded-archs}}
93100 override-name : ${{matrix.variant.override-name}}
101+ sdks : ${{ needs.setup-matrix.outputs.sdk-list-string }}
94102 strategy :
95103 matrix :
96- variant :
97- - scheme : Sentry
98- macho-type : mh_dylib
99- suffix : " -Dynamic"
100- id : sentry-dynamic
101- excluded-archs : arm64e
102- - scheme : Sentry
103- macho-type : mh_dylib
104- suffix : " -Dynamic"
105- id : sentry-dynamic
106- override-name : Sentry-Dynamic-WithARM64e
107- - scheme : Sentry
108- macho-type : staticlib
109- id : sentry-static
110- - scheme : SentrySwiftUI
111- macho-type : mh_dylib
112- id : sentry-swiftui
113- - scheme : Sentry
114- macho-type : mh_dylib
115- suffix : " -WithoutUIKitOrAppKit"
116- configuration-suffix : WithoutUIKit
117- id : sentry-withoutuikit-dynamic
118- excluded-archs : arm64e
119- - scheme : Sentry
120- macho-type : mh_dylib
121- suffix : " -WithoutUIKitOrAppKit"
122- configuration-suffix : WithoutUIKit
123- id : sentry-withoutuikit-dynamic
124- override-name : Sentry-WithoutUIKitOrAppKit-WithARM64e
104+ variant : ${{ fromJson(needs.setup-matrix.outputs.variants) }}
125105
126106 validate-xcframework :
127107 name : Validate XCFramework
@@ -156,16 +136,11 @@ jobs:
156136 with :
157137 pattern : xcframework-${{github.sha}}-*
158138 merge-multiple : true
159- - name : Remove newer package files
160- if : ${{ matrix.package-file.name == 'Package.swift' }}
161- run : rm -rf Package@swift*
162- - name : Change path of the framework
163- run : |
164- sed -i '' 's/url.*//g' ${{matrix.package-file.name}}
165- sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' ${{matrix.package-file.name}}
166- sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic-WithARM64e/path: "Sentry-Dynamic-WithARM64e.xcframework.zip"/g' ${{matrix.package-file.name}}
167- sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' ${{matrix.package-file.name}}
168- shell : bash
139+ - name : Prepare Package.swift
140+ uses : ./.github/actions/prepare-package.swift
141+ with :
142+ is-pr : ${{ github.event_name == 'pull_request' }}
143+ package-file : ${{matrix.package-file.name}}
169144 - run : swift build
170145 working-directory : Samples/macOS-SPM-CommandLine
171146 - name : Run CI Diagnostics
@@ -187,16 +162,11 @@ jobs:
187162 with :
188163 pattern : xcframework-${{github.sha}}-*
189164 merge-multiple : true
190- - name : Remove newer package files
191- if : ${{ matrix.package-file.name == 'Package.swift' }}
192- run : rm -rf Package@swift*
193- - name : Change path of the framework
194- run : |
195- sed -i '' 's/url.*//g' ${{matrix.package-file.name}}
196- sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' ${{matrix.package-file.name}}
197- sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic-WithARM64e/path: "Sentry-Dynamic-WithARM64e.xcframework.zip"/g' ${{matrix.package-file.name}}
198- sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' ${{matrix.package-file.name}}
199- shell : bash
165+ - name : Prepare Package.swift
166+ uses : ./.github/actions/prepare-package.swift
167+ with :
168+ is-pr : ${{ github.event_name == 'pull_request' }}
169+ package-file : ${{matrix.package-file.name}}
200170 - run : swift build
201171 working-directory : Samples/SPM-Dynamic
202172 - name : Run CI Diagnostics
@@ -218,16 +188,11 @@ jobs:
218188 with :
219189 pattern : xcframework-${{github.sha}}-*
220190 merge-multiple : true
221- - name : Remove newer package files
222- if : ${{ matrix.package-file.name == 'Package.swift' }}
223- run : rm -rf Package@swift*
224- - name : Change path of the framework
225- run : |
226- sed -i '' 's/url.*//g' ${{matrix.package-file.name}}
227- sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' ${{matrix.package-file.name}}
228- sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic-WithARM64e/path: "Sentry-Dynamic-WithARM64e.xcframework.zip"/g' ${{matrix.package-file.name}}
229- sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' ${{matrix.package-file.name}}
230- shell : bash
191+ - name : Prepare Package.swift
192+ uses : ./.github/actions/prepare-package.swift
193+ with :
194+ is-pr : ${{ github.event_name == 'pull_request' }}
195+ package-file : ${{matrix.package-file.name}}
231196 - run : swift build
232197 - name : Run CI Diagnostics
233198 if : failure()
0 commit comments