Skip to content

Merge branch 'release/9.6.0' #19201

Merge branch 'release/9.6.0'

Merge branch 'release/9.6.0' #19201

Workflow file for this run

name: Build
on:
push:
branches:
- main
- v8.x
- release/**
pull_request:
types: [opened, synchronize, reopened, labeled]
# Concurrency configuration:
# - We use workflow-specific concurrency groups to prevent multiple build runs of the same code,
# which would waste CI resources without providing additional value.
# - For pull requests, we cancel in-progress builds when new commits are pushed since only the
# latest commit's build results matter for merge decisions.
# - For main branch pushes, we never cancel builds to ensure all release and sample builds complete,
# as broken builds on main could block releases and affect downstream consumers.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
ready-to-merge-gate:
name: Ready-to-merge gate
uses: ./.github/workflows/ready-to-merge-workflow.yml
files-changed:
name: Detect File Changes
runs-on: ubuntu-latest
needs: ready-to-merge-gate
outputs:
run_build_for_prs: ${{ steps.changes.outputs.run_build_for_prs }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Get changed files
id: changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
with:
token: ${{ github.token }}
filters: .github/file-filters.yml
# We had issues that the release build was broken on main.
# With this we catch potential issues already in the PR.
ios-swift-release:
name: Release Build of iOS Swift
# Run the job for PRs with related changes (including external contributors) or non-PR events.
# Don't run this on release branches, cause the SPM Package.swift points to the unreleased versions.
if: startsWith(github.ref, 'refs/heads/release/') == false && (github.event_name != 'pull_request' || needs.files-changed.outputs.run_build_for_prs == 'true')
needs: files-changed
runs-on: macos-26
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
# As the DistributionSample project uses local SPM, xcodebuild resolves SPM dependencies for all
# sample projects. The Package.swift references binary targets, which in release branch commits points
# to non-existent download URLs. This creates chicken-egg failures when building these sample apps for
# a release commit build. When building these sample apps for a release commit, xcodebuild tries to
# resolve all SPM dependencies, including the binary targets pointing to these non-existent URLs. The
# sample projects don't use SPM for including Sentry. Only the DistributionSample uses local SPM.
# Therefore, we only keep the local DistributionSample reference in the Package.swift as a workaround.
- name: Only keep distribution lib and target in Package.swift
run: ./scripts/prepare-package.sh --remove-binary-targets true
- run: ./scripts/ci-select-xcode.sh 26.2
- name: Setup Ruby
uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
with:
bundler-cache: true
- run: make init-ci-build
- run: make xcode-ci
- name: Run Fastlane
# We only need to archive, not package the IPA, so we skip codesigning.
run: bundle exec fastlane build_ios_swift_without_codesigning
- name: Debug Xcode environment
if: ${{ failure() || cancelled() }}
run: ./scripts/ci-diagnostics.sh
build-sample:
name: Sample ${{ matrix.scheme }} ${{ matrix.config }}
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_build_for_prs == 'true'
needs: files-changed
runs-on: macos-15
strategy:
fail-fast: false
matrix:
# other sample projects are built in ui-tests
include:
- scheme: watchOS-Swift WatchKit App
config: Debug
- scheme: macOS-SwiftUI
config: Debug
- scheme: SessionReplay-CameraTest
config: Debug
- scheme: iOS-Swift
config: Debug
- scheme: macOS-Swift
config: Debug
- scheme: tvOS-Swift
config: Debug
- scheme: visionOS-Swift
config: Debug
- scheme: iOS-SwiftUI
config: Debug
- scheme: iOS-ObjectiveC
config: Debug
- scheme: SPM
config: Debug
- scheme: DistributionSample
config: Debug
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
# As the DistributionSample project uses local SPM, xcodebuild resolves SPM dependencies for all
# sample projects. The Package.swift references binary targets, which in release branch commits points
# to non-existent download URLs. This creates chicken-egg failures when building these sample apps for
# a release commit build. When building these sample apps for a release commit, xcodebuild tries to
# resolve all SPM dependencies, including the binary targets pointing to these non-existent URLs. The
# sample projects don't use SPM for including Sentry. Only the DistributionSample uses local SPM.
# Therefore, we only keep the local DistributionSample reference in the Package.swift as a workaround.
- name: Only keep distribution lib and target in Package.swift
run: ./scripts/prepare-package.sh --remove-binary-targets true
- run: ./scripts/ci-select-xcode.sh 16.4
- run: make init-ci-build
- run: make xcode-ci
# Note: Due to complexity in implementing the CODE_SIGNING_ALLOWED flag in the sentry-xcodebuild.sh script,
# we did not yet migrate this step to use the script yet.
- run: |
set -o pipefail && NSUnbufferedIO=YES xcodebuild \
-workspace Sentry.xcworkspace \
-scheme '${{matrix.scheme}}' \
-configuration '${{matrix.config}}' \
CODE_SIGNING_ALLOWED="NO" \
build 2>&1 | tee raw-build-output.log | xcbeautify --preserve-unbeautified
- name: Archiving Raw Build Logs
uses: actions/upload-artifact@v7
if: ${{ failure() || cancelled() }}
with:
name: raw-build-output-scheme-${{matrix.scheme}}
path: |
raw-build-output.log
- name: Debug Xcode environment
if: ${{ failure() || cancelled() }}
run: ./scripts/ci-diagnostics.sh
build-sample-spm:
name: Sample SPM ${{ matrix.name }}
# Don't run this on release branches, cause the SPM Package.swift points to the unreleased versions.
if: startsWith(github.ref, 'refs/heads/release/') == false && (github.event_name != 'pull_request' || needs.files-changed.outputs.run_build_for_prs == 'true')
needs: files-changed
runs-on: macos-26
strategy:
fail-fast: false
matrix:
include:
- name: iOS
make-target: build-sample-iOS-SwiftUI-SPM
- name: watchOS
make-target: build-sample-watchOS-SwiftUI-SPM
- name: tvOS
make-target: build-sample-tvOS-SwiftUI-SPM
- name: macOS
make-target: build-sample-macOS-SwiftUI-SPM
- name: visionOS
make-target: build-sample-visionOS-SwiftUI-SPM
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Select Xcode
run: ./scripts/ci-select-xcode.sh 26.2
- name: Install xcodegen
run: brew install xcodegen
- name: Build Sample
run: make ${{ matrix.make-target }}
env:
IOS_SIMULATOR_OS: latest
IOS_DEVICE_NAME: iPhone 17 Pro
- name: Debug Xcode environment
if: ${{ failure() || cancelled() }}
run: ./scripts/ci-diagnostics.sh
build-distribution:
name: Build the distribution framework
runs-on: macos-15
# Don't run this on release branches, cause the SPM Package.swift points to the unreleased versions.
if: startsWith(github.ref, 'refs/heads/release/') == false && (github.event_name != 'pull_request' || needs.files-changed.outputs.run_build_for_prs == 'true')
needs: files-changed
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- run: ./scripts/ci-select-xcode.sh 16.4
shell: sh
- run: rm -r Sentry.xcodeproj && rm -r Sentry.xcworkspace
- run: |
set -o pipefail && NSUnbufferedIO=YES xcodebuild \
-scheme SentryDistribution \
-sdk iphoneos \
-destination 'generic/platform=iphoneos' \
build | tee raw-build-output-spm.log | xcbeautify --preserve-unbeautified
shell: sh
- name: Upload SPM Build Logs
uses: actions/upload-artifact@v7
if: ${{ failure() || cancelled() }}
with:
name: raw-build-output-spm
path: |
raw-build-output-spm.log
build-spm:
name: Build with SPM
runs-on: macos-15
# Don't run this on release branches, cause the SPM Package.swift points to the unreleased versions.
if: startsWith(github.ref, 'refs/heads/release/') == false && (github.event_name != 'pull_request' || needs.files-changed.outputs.run_build_for_prs == 'true')
needs: files-changed
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- run: ./scripts/ci-select-xcode.sh 16.4
shell: sh
- run: rm -r Sentry.xcodeproj && rm -r Sentry.xcworkspace
- run: |
set -o pipefail && NSUnbufferedIO=YES xcodebuild \
-scheme SentrySPM \
-sdk watchos \
-destination 'generic/platform=watchOS' \
build | tee raw-build-output-spm-watchos.log | xcbeautify --preserve-unbeautified
shell: sh
- run: |
set -o pipefail && NSUnbufferedIO=YES xcodebuild \
-scheme SentrySPM \
-sdk iphoneos \
-destination 'generic/platform=iphoneos' \
build | tee raw-build-output-spm-iphoneos.log | xcbeautify --preserve-unbeautified
shell: sh
- name: Upload SPM Build Logs
uses: actions/upload-artifact@v7
if: ${{ failure() || cancelled() }}
with:
name: raw-build-output-spm
path: |
raw-build-output-spm-watchos.log
raw-build-output-spm-iphoneos.log
- name: Debug Xcode environment
if: ${{ failure() || cancelled() }}
run: ./scripts/ci-diagnostics.sh
check-debug-without-UIKit:
name: Check no UIKit linkage (DebugWithoutUIKit)
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_build_for_prs == 'true'
needs: files-changed
runs-on: macos-15
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- run: ./scripts/ci-select-xcode.sh 16.4
- name: Build for Debug
run: |
./scripts/sentry-xcodebuild.sh \
--platform iOS \
--os 18.5 \
--ref ${{ github.ref }} \
--command build \
--device "iPhone 16 Pro" \
--configuration DebugWithoutUIKit \
--derived-data uikit-check-build
- name: Ensure UIKit is not linked
run: ./scripts/check-ui-framework-linkage.sh --configuration DebugWithoutUIKit --derived-data uikit-check-build --linkage unlinked --module SentryWithoutUIKit
- name: Debug Xcode environment
if: ${{ failure() || cancelled() }}
run: ./scripts/ci-diagnostics.sh
check-release-without-UIKit:
name: Check no UIKit linkage (ReleaseWithoutUIKit)
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_build_for_prs == 'true'
needs: files-changed
runs-on: macos-15
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- run: ./scripts/ci-select-xcode.sh 16.4
- name: Build for Release
run: |
./scripts/sentry-xcodebuild.sh \
--platform iOS \
--os 18.5 \
--ref ${{ github.ref }} \
--command build \
--device "iPhone 16 Pro" \
--configuration ReleaseWithoutUIKit \
--derived-data uikit-check-build
- name: Ensure UIKit is not linked
run: ./scripts/check-ui-framework-linkage.sh --configuration ReleaseWithoutUIKit --derived-data uikit-check-build --linkage unlinked --module SentryWithoutUIKit
- name: Debug Xcode environment
if: ${{ failure() || cancelled() }}
run: ./scripts/ci-diagnostics.sh
check-debug-with-UIKit:
name: Check UIKit linkage (Debug)
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_build_for_prs == 'true'
needs: files-changed
runs-on: macos-15
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- run: ./scripts/ci-select-xcode.sh 16.4
- name: Build for Debug
run: |
./scripts/sentry-xcodebuild.sh \
--platform iOS \
--os 18.5 \
--ref ${{ github.ref }} \
--command build \
--device "iPhone 16 Pro" \
--configuration Debug \
--derived-data uikit-check-build
- name: Ensure UIKit is linked
run: ./scripts/check-ui-framework-linkage.sh --configuration Debug --derived-data uikit-check-build --linkage linked --module Sentry
- name: Debug Xcode environment
if: ${{ failure() || cancelled() }}
run: ./scripts/ci-diagnostics.sh
check-release-with-UIKit:
name: Check UIKit linkage (Release)
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_build_for_prs == 'true'
needs: files-changed
runs-on: macos-15
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- run: ./scripts/ci-select-xcode.sh 16.4
- name: Build for Release
run: |
./scripts/sentry-xcodebuild.sh \
--platform iOS \
--os 18.5 \
--ref ${{ github.ref }} \
--command build \
--device "iPhone 16 Pro" \
--configuration Release \
--derived-data uikit-check-build
- name: Ensure UIKit is linked
run: ./scripts/check-ui-framework-linkage.sh --configuration Release --derived-data uikit-check-build --linkage linked --module Sentry
- name: Debug Xcode environment
if: ${{ failure() || cancelled() }}
run: ./scripts/ci-diagnostics.sh
check-release-with-AppKit:
name: Check AppKit linkage (Release)
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_build_for_prs == 'true'
needs: files-changed
runs-on: macos-15
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- run: ./scripts/ci-select-xcode.sh 16.4
- name: Build for Release
run: |
./scripts/sentry-xcodebuild.sh \
--platform macOS \
--os 15.0 \
--ref ${{ github.ref }} \
--command build \
--configuration Release \
--derived-data appkit-check-build
- name: Ensure AppKit is linked
run: ./scripts/check-ui-framework-linkage.sh --configuration Release --derived-data appkit-check-build --linkage linked --module Sentry --framework AppKit
- name: Debug Xcode environment
if: ${{ failure() || cancelled() }}
run: ./scripts/ci-diagnostics.sh
check-release-without-AppKit:
name: Check no AppKit linkage (ReleaseWithoutUIKit)
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_build_for_prs == 'true'
needs: files-changed
runs-on: macos-15
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- run: ./scripts/ci-select-xcode.sh 16.4
- name: Build for Release
run: |
./scripts/sentry-xcodebuild.sh \
--platform macOS \
--os 15.0 \
--ref ${{ github.ref }} \
--command build \
--configuration ReleaseWithoutUIKit \
--derived-data no-appkit-check-build
- name: Ensure AppKit is not linked
run: ./scripts/check-ui-framework-linkage.sh --configuration ReleaseWithoutUIKit --derived-data no-appkit-check-build --linkage unlinked --module SentryWithoutUIKit --framework AppKit
- name: Debug Xcode environment
if: ${{ failure() || cancelled() }}
run: ./scripts/ci-diagnostics.sh
# The compiler only evaluates SentryAsyncSafeLogs that get printed based on the SENTRY_ASYNC_SAFE_LOG_LEVEL.
# So if the level is set to error, which is the default, and a SENTRY_ASYNC_SAFE_LOG_DEBUG has a compiler error,
# you only get the compiler error when setting the SENTRY_ASYNC_SAFE_LOG_LEVEL to SENTRY_ASYNC_SAFE_LOG_LEVEL_DEBUG or lower.
check-compiling-async-safe-logs:
name: Check compiling Async Safe Logs
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_build_for_prs == 'true'
needs: files-changed
runs-on: macos-15
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
# If the SentryAsyncSafeLog doesn't contain the SENTRY_ASYNC_SAFE_LOG_LEVEL_ERROR this fails.
- name: Async Safe Log Level is Error
run: grep -c "SENTRY_ASYNC_SAFE_LOG_LEVEL SENTRY_ASYNC_SAFE_LOG_LEVEL_ERROR" Sources/Sentry/SentryAsyncSafeLog.h
- name: Set Async Safe Log Level to Debug
run: |
sed -i '' 's/#define SENTRY_ASYNC_SAFE_LOG_LEVEL SENTRY_ASYNC_SAFE_LOG_LEVEL_ERROR/#define SENTRY_ASYNC_SAFE_LOG_LEVEL SENTRY_ASYNC_SAFE_LOG_LEVEL_TRACE/' Sources/Sentry/SentryAsyncSafeLog.h
shell: bash
- run: ./scripts/ci-select-xcode.sh 16.4
- name: Build for Debug
run: |
./scripts/sentry-xcodebuild.sh \
--platform iOS \
--os 18.5 \
--ref ${{ github.ref }} \
--command build \
--device "iPhone 16 Pro" \
--configuration Debug
- name: Debug Xcode environment
if: ${{ failure() || cancelled() }}
run: ./scripts/ci-diagnostics.sh
build-required-check:
needs:
[
files-changed,
ios-swift-release,
build-sample,
build-sample-spm,
build-distribution,
build-spm,
check-debug-without-UIKit,
check-release-without-UIKit,
check-debug-with-UIKit,
check-release-with-UIKit,
check-release-with-AppKit,
check-release-without-AppKit,
check-compiling-async-safe-logs,
ready-to-merge-gate,
]
name: Build
# This is necessary since a failed/skipped dependent job would cause this job to be skipped
if: always()
runs-on: ubuntu-latest
steps:
# If any jobs we depend on fails gets cancelled or times out, this job will fail.
# Skipped jobs are not considered failures.
- name: Check for failures
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: |
echo "One of the build jobs has failed." && exit 1