77 - release/**
88
99 pull_request :
10+ types : [opened, synchronize, reopened, labeled]
1011
1112# Concurrency configuration:
1213# - We use workflow-specific concurrency groups to prevent multiple build runs of the same code,
@@ -20,9 +21,17 @@ concurrency:
2021 cancel-in-progress : ${{ github.event_name == 'pull_request' }}
2122
2223jobs :
24+ ready-to-merge-gate :
25+ name : Ready-to-merge gate
26+ uses : ./.github/workflows/ready-to-merge-workflow.yml
27+ with :
28+ is-pr : ${{ github.event_name == 'pull_request' }}
29+ labels : ${{ toJson(github.event.pull_request.labels) }}
30+
2331 files-changed :
2432 name : Detect File Changes
2533 runs-on : ubuntu-latest
34+ needs : ready-to-merge-gate
2635 outputs :
2736 run_build_for_prs : ${{ steps.changes.outputs.run_build_for_prs }}
2837 steps :
@@ -39,11 +48,23 @@ jobs:
3948 ios-swift-release :
4049 name : Release Build of iOS Swift
4150 # Run the job only for PRs with related changes or non-PR events.
42- if : github.event_name != 'pull_request' || needs.files-changed.outputs.run_build_for_prs == 'true'
51+ # Don't run this on release branches, cause the SPM Package.swift points to the unreleased versions.
52+ if : startsWith(github.ref, 'refs/heads/release/') == false && (github.event_name != 'pull_request' || needs.files-changed.outputs.run_build_for_prs == 'true')
4353 needs : files-changed
4454 runs-on : macos-15
4555 steps :
4656 - uses : actions/checkout@v5
57+
58+ # As the DistributionSample project uses local SPM, xcodebuild resolves SPM dependencies for all
59+ # sample projects. The Package.swift references binary targets, which in release branch commits points
60+ # to non-existent download URLs. This creates chicken-egg failures when building these sample apps for
61+ # a release commit build. When building these sample apps for a release commit, xcodebuild tries to
62+ # resolve all SPM dependencies, including the binary targets pointing to these non-existent URLs. The
63+ # sample projects don't use SPM for including Sentry. Only the DistributionSample uses local SPM.
64+ # Therefore, we only keep the local DistributionSample reference in the Package.swift as a workaround.
65+ - name : Only keep distribution lib and target in Package.swift
66+ run : ./scripts/prepare-package.sh --only-keep-distribution true
67+
4768 - run : ./scripts/ci-select-xcode.sh 16.4
4869 - uses : ruby/setup-ruby@v1
4970 with :
@@ -98,6 +119,17 @@ jobs:
98119
99120 steps :
100121 - uses : actions/checkout@v5
122+
123+ # As the DistributionSample project uses local SPM, xcodebuild resolves SPM dependencies for all
124+ # sample projects. The Package.swift references binary targets, which in release branch commits points
125+ # to non-existent download URLs. This creates chicken-egg failures when building these sample apps for
126+ # a release commit build. When building these sample apps for a release commit, xcodebuild tries to
127+ # resolve all SPM dependencies, including the binary targets pointing to these non-existent URLs. The
128+ # sample projects don't use SPM for including Sentry. Only the DistributionSample uses local SPM.
129+ # Therefore, we only keep the local DistributionSample reference in the Package.swift as a workaround.
130+ - name : Only keep distribution lib and target in Package.swift
131+ run : ./scripts/prepare-package.sh --only-keep-distribution true
132+
101133 - run : ./scripts/ci-select-xcode.sh 16.4
102134 - run : make init-ci-build
103135 - run : make xcode-ci
@@ -129,12 +161,15 @@ jobs:
129161 build-distribution :
130162 name : Build the distribution framework
131163 runs-on : macos-15
164+ # Don't run this on release branches, cause the SPM Package.swift points to the unreleased versions.
165+ if : startsWith(github.ref, 'refs/heads/release/') == false && (github.event_name != 'pull_request' || needs.files-changed.outputs.run_build_for_prs == 'true')
132166 needs : files-changed
133167 steps :
134168 - uses : actions/checkout@v5
135169
136170 - run : ./scripts/ci-select-xcode.sh 16.4
137171 shell : sh
172+
138173 - run : rm -r Sentry.xcodeproj && rm -r Sentry.xcworkspace
139174 - run : set -o pipefail && NSUnbufferedIO=YES xcodebuild build -scheme SentryDistribution -sdk iphoneos -destination 'generic/platform=iphoneos' | tee raw-build-output-spm.log | xcbeautify
140175 shell : sh
0 commit comments