Release dc4975fb8f909f14f5e6688b69dadec0a2b5e515 #1083
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
run-name: Release ${{ github.event.inputs.version || github.sha }} | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
paths: | |
- "Sources/**" | |
- "scripts/ci-select-xcode.sh" | |
- Sentry.xcworkspace/** | |
- Sentry.xcodeproj/** | |
- "Package.swift" | |
- ".github/workflows/build-xcframework.yml" | |
- "scripts/build-xcframework-slice.sh" | |
- "scripts/assemble-xcframework.sh" | |
- ".github/workflows/release.yml" | |
- ".github/workflows/build-xcframework-variant-slices.yml" | |
- ".github/workflows/assemble-xcframework-variant.yml" | |
- ".github/workflows/ui-tests-common.yml" | |
- Samples/macOS-SPM-CommandLine/** | |
- Samples/SPM-Dynamic/** | |
workflow_dispatch: | |
inputs: | |
version: | |
description: Version to release | |
required: true | |
force: | |
description: Force a release even when there are release-blockers (optional) | |
required: false | |
merge_target: | |
description: Target branch to merge into. Uses the default branch as a fallback (optional) | |
required: false | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
build-xcframework-variant-slices: | |
uses: ./.github/workflows/build-xcframework-variant-slices.yml | |
with: | |
name: ${{matrix.variant.name}} | |
suffix: ${{matrix.variant.suffix}} | |
macho-type: ${{matrix.variant.macho-type}} | |
configuration-suffix: ${{matrix.variant.configuration-suffix}} | |
variant-id: ${{matrix.variant.id}} | |
release-version: ${{ github.event.inputs.version }} | |
strategy: | |
matrix: | |
variant: | |
- name: Sentry | |
macho-type: mh_dylib | |
suffix: "-Dynamic" | |
id: sentry-dynamic | |
- name: Sentry | |
macho-type: staticlib | |
id: sentry-static | |
- name: SentrySwiftUI | |
macho-type: mh_dylib | |
id: sentry-swiftui | |
- name: Sentry | |
macho-type: mh_dylib | |
suffix: "-WithoutUIKitOrAppKit" | |
configuration-suffix: WithoutUIKit | |
id: sentry-withoutuikit-dynamic | |
assemble-xcframework-variant: | |
needs: build-xcframework-variant-slices | |
uses: ./.github/workflows/assemble-xcframework-variant.yml | |
secrets: inherit | |
with: | |
name: ${{matrix.variant.name}} | |
suffix: ${{matrix.variant.suffix}} | |
configuration-suffix: ${{matrix.variant.configuration-suffix}} | |
variant-id: ${{matrix.variant.id}} | |
signed: true | |
release-version: ${{ github.event.inputs.version }} | |
strategy: | |
matrix: | |
variant: | |
- name: Sentry | |
macho-type: mh_dylib | |
suffix: "-Dynamic" | |
id: sentry-dynamic | |
- name: Sentry | |
macho-type: staticlib | |
id: sentry-static | |
- name: SentrySwiftUI | |
macho-type: mh_dylib | |
id: sentry-swiftui | |
- name: Sentry | |
macho-type: mh_dylib | |
suffix: "-WithoutUIKitOrAppKit" | |
configuration-suffix: WithoutUIKit | |
id: sentry-withoutuikit-dynamic | |
validate-xcframework: | |
name: Validate XCFramework | |
runs-on: macos-13 | |
needs: assemble-xcframework-variant | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: xcframework-${{github.sha}}-sentry-static | |
path: Carthage/ | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: xcframework-${{github.sha}}-sentry-swiftui | |
path: Carthage/ | |
- run: find Carthage -name "*.zip" -print0 | xargs -t0I @ mv @ Carthage | |
- run: ./scripts/ci-select-xcode.sh 15.2 | |
- run: make build-xcframework-sample | |
# Use github.event.pull_request.head.sha instead of github.sha when available as | |
# the github.sha is be the pre merge commit id for PRs. | |
# See https://github.community/t/github-sha-isnt-the-value-expected/17903/17906. | |
validate-spm: | |
name: Validate Swift Package Manager | |
runs-on: macos-13 | |
needs: assemble-xcframework-variant | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: xcframework-${{github.sha}}-* | |
merge-multiple: true | |
- name: Change path of the framework | |
run: | | |
sed -i '' 's/url.*//g' Package.swift | |
sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' Package.swift | |
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' Package.swift | |
shell: bash | |
- run: swift build | |
working-directory: Samples/macOS-SPM-CommandLine | |
validate-spm-dynamic: | |
name: Validate Swift Package Manager Dynamic | |
runs-on: macos-13 | |
needs: assemble-xcframework-variant | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: xcframework-${{github.sha}}-* | |
merge-multiple: true | |
- name: Change path of the framework | |
run: | | |
sed -i '' 's/url.*//g' Package.swift | |
sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' Package.swift | |
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' Package.swift | |
shell: bash | |
- run: swift build | |
working-directory: Samples/SPM-Dynamic | |
swift-build: | |
name: Build with Swift | |
runs-on: macos-13 | |
needs: assemble-xcframework-variant | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: xcframework-${{github.sha}}-* | |
merge-multiple: true | |
- name: Change path of the framework | |
run: | | |
sed -i '' 's/url.*//g' Package.swift | |
sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' Package.swift | |
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' Package.swift | |
shell: bash | |
- run: swift build | |
duplication-tests: | |
name: UI Tests for project with Sentry duplicated - V4 # Up the version with every change to keep track of flaky tests | |
uses: ./.github/workflows/ui-tests-common.yml | |
needs: assemble-xcframework-variant | |
with: | |
fastlane_command: duplication_test | |
xcode_version: 16.4 | |
macos_version: macos-15 | |
needs_xcframework: true | |
app-metrics: | |
name: Collect app metrics | |
runs-on: macos-15 | |
needs: assemble-xcframework-variant | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v4 | |
- run: ./scripts/ci-select-xcode.sh 16.3 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- uses: actions/cache@v4 | |
id: app-plain-cache | |
with: | |
path: Tests/Perf/test-app-plain.ipa | |
key: ${{ github.workflow }}-${{ github.job }}-appplain-${{ hashFiles('fastlane/Fastfile', 'Tests/Perf/test-app-plain/**') }} | |
- name: Build test app plain | |
if: steps.app-plain-cache.outputs['cache-hit'] != 'true' | |
run: bundle exec fastlane build_perf_test_app_plain | |
env: | |
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }} | |
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} | |
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }} | |
FASTLANE_KEYCHAIN_PASSWORD: ${{ secrets.FASTLANE_KEYCHAIN_PASSWORD }} | |
MATCH_GIT_PRIVATE_KEY: ${{ secrets.MATCH_GIT_PRIVATE_KEY }} | |
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }} | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: xcframework-${{github.sha}}-sentry-dynamic | |
path: Carthage/ | |
- run: find Carthage -name "Sentry-Dynamic.xcframework.zip" -print0 | xargs -t0I @ unzip @ -d Carthage | |
- name: Build test app with sentry | |
run: bundle exec fastlane build_perf_test_app_sentry | |
env: | |
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }} | |
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} | |
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }} | |
FASTLANE_KEYCHAIN_PASSWORD: ${{ secrets.FASTLANE_KEYCHAIN_PASSWORD }} | |
MATCH_GIT_PRIVATE_KEY: ${{ secrets.MATCH_GIT_PRIVATE_KEY }} | |
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }} | |
- name: Collect app metrics | |
uses: getsentry/action-app-sdk-overhead-metrics@c9eca50e02d180ee07a02952c062b2f3f545f735 | |
with: | |
config: Tests/Perf/metrics-test.yml | |
sauce-user: ${{ secrets.SAUCE_USERNAME }} | |
sauce-key: ${{ secrets.SAUCE_ACCESS_KEY }} | |
job_release: | |
runs-on: ubuntu-latest | |
name: "Release a new version" | |
needs: [ | |
validate-xcframework, | |
validate-spm, | |
validate-spm-dynamic, | |
swift-build, | |
duplication-tests, | |
app-metrics, | |
] | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
steps: | |
- name: Get auth token | |
id: token | |
uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 | |
with: | |
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }} | |
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }} | |
- name: Check out current commit (${{ github.sha }}) | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ steps.token.outputs.token }} | |
fetch-depth: 0 | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: xcframework-${{github.sha}}-* | |
merge-multiple: true | |
path: Carthage/ | |
- name: Archive XCFrameworks for Craft | |
uses: actions/upload-artifact@v4 | |
with: | |
name: xcframeworks.zip | |
if-no-files-found: error | |
overwrite: true | |
path: | | |
${{github.workspace}}/Carthage/*.zip | |
# update-package-sha.sh uses this env variable to update Package.swift. | |
# During release Craft calls bump.sh that uses update-package-sha.sh. | |
- run: export GITHUB_RUN_ID="$GITHUB_RUN_ID" | |
env: | |
GITHUB_RUN_ID: ${{ github.run_id }} | |
- name: Prepare release | |
uses: getsentry/action-prepare-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ steps.token.outputs.token }} | |
with: | |
version: ${{ github.event.inputs.version }} | |
force: ${{ github.event.inputs.force }} | |
merge_target: ${{ github.event.inputs.merge_target }} |