@@ -46,11 +46,29 @@ jobs:
46
46
token : ${{ github.token }}
47
47
filters : .github/file-filters.yml
48
48
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
+
49
67
build-xcframework-variant-slices :
50
68
name : Build XCFramework Slices
51
69
# Run the job only for PRs with related changes or non-PR events.
52
70
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]
54
72
uses : ./.github/workflows/build-xcframework-variant-slices.yml
55
73
with :
56
74
name : ${{matrix.variant.name}}
@@ -59,27 +77,13 @@ jobs:
59
77
configuration-suffix : ${{matrix.variant.configuration-suffix}}
60
78
variant-id : ${{matrix.variant.id}}
61
79
release-version : ${{ github.event.inputs.version }}
80
+ sdk-list : ${{ needs.setup-matrix.outputs.sdk-list-array }}
62
81
strategy :
63
82
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) }}
80
84
81
85
assemble-xcframework-variant :
82
- needs : [files-changed, build-xcframework-variant-slices]
86
+ needs : [files-changed, build-xcframework-variant-slices, setup-matrix ]
83
87
# Run the job only for PRs with related changes or non-PR events.
84
88
if : github.event_name != 'pull_request' || needs.files-changed.outputs.run_release_for_prs == 'true'
85
89
name : Assemble XCFramework Variant
@@ -94,37 +98,10 @@ jobs:
94
98
release-version : ${{ github.event.inputs.version }}
95
99
excluded-archs : ${{matrix.variant.excluded-archs}}
96
100
override-name : ${{matrix.variant.override-name}}
101
+ sdks : ${{ needs.setup-matrix.outputs.sdk-list-string }}
97
102
strategy :
98
103
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) }}
128
105
129
106
validate-xcframework :
130
107
name : Validate XCFramework
@@ -163,16 +140,11 @@ jobs:
163
140
with :
164
141
pattern : xcframework-${{github.sha}}-*
165
142
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}}
176
148
- run : swift build
177
149
working-directory : Samples/macOS-SPM-CommandLine
178
150
- name : Run CI Diagnostics
@@ -196,16 +168,11 @@ jobs:
196
168
with :
197
169
pattern : xcframework-${{github.sha}}-*
198
170
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}}
209
176
- run : swift build
210
177
working-directory : Samples/SPM-Dynamic
211
178
- name : Run CI Diagnostics
@@ -229,16 +196,11 @@ jobs:
229
196
with :
230
197
pattern : xcframework-${{github.sha}}-*
231
198
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}}
242
204
- run : swift build
243
205
- name : Run CI Diagnostics
244
206
if : failure()
0 commit comments