@@ -3,7 +3,7 @@ name: Assemble XCFramework Variant
33on :
44 workflow_call :
55 inputs :
6- name :
6+ scheme :
77 description : |-
88 The Sentry project target to build an XCFramework slice for.
99 Possible values: Sentry, SentrySwiftUI.
5151 required : false
5252 type : string
5353
54+ excluded-archs :
55+ description : |-
56+ The archs to exclude from the XCFramework.
57+ required : false
58+ type : string
59+
60+ override-name :
61+ description : |-
62+ The name to use for the XCFramework. If not provided, the default name will be used.
63+ required : false
64+ type : string
65+
5466jobs :
5567 assemble-xcframework-variant :
56- name : ${{inputs.name}}${{ inputs.suffix}}
68+ name : ${{ inputs.override- name || format('{0}{1}', inputs.scheme, inputs. suffix) }}
5769
5870 runs-on : macos-14
5971 steps :
8698 fi
8799 shell : sh
88100
101+ - name : Set XCFramework name
102+ id : set-xcframework-name
103+ run : |
104+ if [ -n "${{ inputs.override-name }}" ]; then
105+ echo "XCFRAMEWORK_NAME=${{ inputs.override-name }}" >> $GITHUB_ENV
106+ else
107+ echo "XCFRAMEWORK_NAME=${{ inputs.scheme }}${{inputs.suffix}}" >> $GITHUB_ENV
108+ fi
109+
89110 - name : Compute cache key
90111 run : |
91112 sdks_string=${{inputs.sdks}}
97118 uses : actions/cache@v4
98119 with :
99120 key : ${{env.SENTRY_XCFRAMEWORK_CACHE_KEY}}
100- path : ${{inputs.name}}${{inputs.suffix }}.xcframework.zip
121+ path : ${{env.XCFRAMEWORK_NAME }}.xcframework.zip
101122
102123 - name : Download ${{inputs.variant-id}} Slices
103124 if : steps.cache-xcframework.outputs.cache-hit != 'true'
@@ -112,26 +133,33 @@ jobs:
112133 find xcframework-slices -type f -print0 | xargs -t0I @ unzip @ -d xcframework-slices
113134 shell : bash
114135
136+ - name : Remove excluded archs
137+ if : ${{ steps.cache-xcframework.outputs.cache-hit != 'true' && inputs.excluded-archs != '' }}
138+ run : ./scripts/remove-architectures.sh xcframework-slices/ "${{ inputs.excluded-archs }}"
139+ shell : bash
140+
115141 - name : Assemble XCFramework
116142 if : steps.cache-xcframework.outputs.cache-hit != 'true'
117- run : ./scripts/assemble-xcframework.sh "${{inputs.name }}" "${{inputs.suffix}}" "${{inputs.configuration-suffix}}" "${{inputs.sdks}}" "/Users/runner/work/sentry-cocoa/sentry-cocoa/xcframework-slices/SDK_NAME.xcarchive"
143+ run : ./scripts/assemble-xcframework.sh "${{inputs.scheme }}" "${{inputs.suffix}}" "${{inputs.configuration-suffix}}" "${{inputs.sdks}}" "/Users/runner/work/sentry-cocoa/sentry-cocoa/xcframework-slices/SDK_NAME.xcarchive"
118144 shell : bash
119145
120146 - name : Zip XCFramework
121147 if : steps.cache-xcframework.outputs.cache-hit != 'true'
122- run : ./scripts/compress-xcframework.sh ${{inputs.signed && '--sign' || '--not-signed'}} ${{inputs.name}}${{inputs.suffix}}
148+ run : |
149+ ./scripts/compress-xcframework.sh ${{inputs.signed && '--sign' || '--not-signed'}} ${{inputs.scheme}}${{inputs.suffix}}
150+ mv ${{inputs.scheme}}${{inputs.suffix}}.xcframework.zip ${{env.XCFRAMEWORK_NAME}}.xcframework.zip
123151 shell : bash
124152
125153 - name : Cache XCFramework
126154 uses : actions/cache@v4
127155 with :
128156 key : ${{env.SENTRY_XCFRAMEWORK_CACHE_KEY}}
129- path : ${{inputs.name}}${{inputs.suffix }}.xcframework.zip
157+ path : ${{env.XCFRAMEWORK_NAME }}.xcframework.zip
130158
131159 - name : Upload XCFramework
132160 uses : actions/upload-artifact@v4
133161 with :
134162 overwrite : true
135- name : xcframework-${{github.sha}}-${{inputs.variant-id}}
163+ name : xcframework-${{github.sha}}-${{inputs.override-name || inputs. variant-id}}
136164 if-no-files-found : error
137- path : ${{inputs.name}}${{inputs.suffix }}.xcframework.zip
165+ path : ${{env.XCFRAMEWORK_NAME }}.xcframework.zip
0 commit comments