Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 32 additions & 9 deletions .github/workflows/build-xcframework-variant-slices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,25 @@ jobs:

- name: Get version
id: get-version
env:
GITHUB_SHA: ${{ github.sha }}
RELEASE_VERSION: ${{ inputs.release-version }}
run: |
if [ -n "${{ inputs.release-version }}" ]; then
echo "VERSION=${{ inputs.release-version }}" >> $GITHUB_ENV
if [ -n "$RELEASE_VERSION" ]; then
echo "VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
else
echo "VERSION=$(grep MARKETING_VERSION Sources/Configuration/Versioning.xcconfig | cut -d ' ' -f 3)+${{ github.sha }}" >> $GITHUB_ENV
echo "VERSION=$(grep MARKETING_VERSION Sources/Configuration/Versioning.xcconfig | cut -d ' ' -f 3)+$GITHUB_SHA" >> $GITHUB_ENV
fi
shell: sh

- name: Compute cache key
env:
RUNNER_OS: ${{ runner.os }}
VARIANT_ID: ${{ inputs.variant-id }}
MATRIX_SDK: ${{ matrix.sdk }}
VERSION: ${{ env.VERSION }}
run: |
echo "SENTRY_XCFRAMEWORK_CACHE_KEY=${{ runner.os }}-xcframework-${{inputs.variant-id}}-slice-${{matrix.sdk}}-${{ env.VERSION }}-${{hashFiles('Sources/**')}}-${{hashFiles('Sentry.xcodeproj/**')}}" >> $GITHUB_ENV
echo "SENTRY_XCFRAMEWORK_CACHE_KEY=${RUNNER_OS}-xcframework-${VARIANT_ID}-slice-${MATRIX_SDK}-${VERSION}-${{hashFiles('Sources/**')}}-${{hashFiles('Sentry.xcodeproj/**')}}" >> $GITHUB_ENV

- name: Restore xcarchive cache
id: cache-xcarchive
Expand All @@ -98,28 +106,43 @@ jobs:

- name: Bump version
if: steps.cache-xcarchive.outputs.cache-hit != 'true'
env:
VERSION: ${{ env.VERSION }}
run: |
./scripts/ci-select-xcode.sh 15.2
make bump-version TO=${{ env.VERSION }}
make bump-version TO=$VERSION

- name: Build ${{inputs.name}}${{inputs.suffix}} XCFramework slice for ${{matrix.sdk}}
if: steps.cache-xcarchive.outputs.cache-hit != 'true'
run: ./scripts/build-xcframework-slice.sh ${{matrix.sdk}} ${{inputs.name}} "${{inputs.suffix}}" "${{inputs.macho-type}}" "${{inputs.configuration-suffix}}"
env:
MATRIX_SDK: ${{ matrix.sdk }}
INPUT_NAME: ${{ inputs.name }}
INPUT_SUFFIX: ${{ inputs.suffix }}
INPUT_MACHO_TYPE: ${{ inputs.macho-type }}
INPUT_CONFIG_SUFFIX: ${{ inputs.configuration-suffix }}
run: ./scripts/build-xcframework-slice.sh "$MATRIX_SDK" "$INPUT_NAME" "$INPUT_SUFFIX" "$INPUT_MACHO_TYPE" "$INPUT_CONFIG_SUFFIX"
shell: bash

# The SentrySwiftUI archive build also builds Sentry.framework as a byproduct of the dependency. We need to remove that to avoid downstream assembly tasks from tripping on these extra files. In the future we could investigate using this byproduct instead of running a separate task for Sentry.framework, or use the one already built by that other task instead of rebuilding it here.
- name: Remove Sentry.framework from SentrySwiftUI build
if: steps.cache-xcarchive.outputs.cache-hit != 'true' && inputs.name == 'SentrySwiftUI'
env:
GITHUB_WORKSPACE: ${{ github.workspace }}
run: |
find "${{github.workspace}}/Carthage/archive" -name "Sentry.framework" -print0 | xargs -t0 rm -rf
find "${{github.workspace}}/Carthage/archive" -name "Sentry.framework.dSYM" -print0 | xargs -t0 rm -rf
find "$GITHUB_WORKSPACE/Carthage/archive" -name "Sentry.framework" -print0 | xargs -t0 rm -rf
find "$GITHUB_WORKSPACE/Carthage/archive" -name "Sentry.framework.dSYM" -print0 | xargs -t0 rm -rf
shell: bash

# the upload action broke symlinks in the mac sdk slice's xcarchive
- name: Zip xcarchive
if: steps.cache-xcarchive.outputs.cache-hit != 'true'
env:
GITHUB_WORKSPACE: ${{ github.workspace }}
INPUT_NAME: ${{ inputs.name }}
INPUT_SUFFIX: ${{ inputs.suffix }}
MATRIX_SDK: ${{ matrix.sdk }}
run: |
ditto -c -k -X --rsrc --keepParent ${{github.workspace}}/Carthage/archive/${{inputs.name}}${{inputs.suffix}}/${{matrix.sdk}}.xcarchive ${{inputs.name}}${{inputs.suffix}}.xcarchive.zip
ditto -c -k -X --rsrc --keepParent ${GITHUB_WORKSPACE}/Carthage/archive/${INPUT_NAME}${INPUT_SUFFIX}/${MATRIX_SDK}.xcarchive ${INPUT_NAME}${INPUT_SUFFIX}.xcarchive.zip
shell: bash

- name: Cache xcarchive
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/ui-tests-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,17 @@ jobs:
XCODE_VERSION: ${{ inputs.xcode_version }}
- name: Install required platforms for Xcode 26
if: ${{ inputs.xcode_version == '26.0.1' }}
run: ./scripts/ci-install-xOS-26-platforms.sh --platforms "${{inputs.platform}}"
env:
PLATFORM: ${{ inputs.platform }}
run: ./scripts/ci-install-xOS-26-platforms.sh --platforms "$PLATFORM"

- name: Create simulator device for Xcode 26
if: ${{ inputs.xcode_version == '26.0.1' }}
run: ./scripts/ci-create-simulator.sh --platform "${{inputs.platform}}" --os-version "${{inputs.test-destination-os}}" --device-name "${{inputs.device}}"
env:
PLATFORM: ${{ inputs.platform }}
OS_VERSION: ${{ inputs.test-destination-os }}
DEVICE_NAME: ${{ inputs.device }}
run: ./scripts/ci-create-simulator.sh --platform "$PLATFORM" --os-version "$OS_VERSION" --device-name "$DEVICE_NAME"
- run: make init-ci-build
if: ${{ inputs.build_with_make }}

Expand All @@ -109,9 +115,11 @@ jobs:
- name: Run Fastlane
env:
FASTLANE_COMMAND: ${{ inputs.fastlane_command }}
DEVICE: ${{ inputs.device }}
TEST_DESTINATION_OS: ${{ inputs.test-destination-os }}
run: |
if [ -n "${{inputs.device}}" ] && [ -n "${{inputs.test-destination-os}}" ]; then
bundle exec fastlane "$FASTLANE_COMMAND" device:"${{inputs.device}} (${{inputs.test-destination-os}})"
if [ -n "$DEVICE" ] && [ -n "$TEST_DESTINATION_OS" ]; then
bundle exec fastlane "$FASTLANE_COMMAND" device:"$DEVICE ($TEST_DESTINATION_OS)"
else
bundle exec fastlane "$FASTLANE_COMMAND"
fi
Expand Down
Loading