Prepare 5.0.0 release (#3856) #9574
This file contains 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: build | |
on: | |
push: | |
branches: | |
- main | |
- release/* | |
pull_request: | |
paths-ignore: | |
- "**.md" | |
jobs: | |
build-sentry-native: | |
name: sentry-native (${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
# Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703 | |
os: [ubuntu-latest, windows-latest, macos-15] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- run: git submodule update --init modules/sentry-native | |
- uses: actions/cache@v4 | |
id: cache | |
with: | |
path: src/Sentry/Platforms/Native/sentry-native | |
key: sentry-native-${{ runner.os }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} | |
enableCrossOsArchive: true | |
- name: Remove unused applications | |
uses: ./.github/actions/freediskspace | |
- name: Install build dependencies | |
if: steps.cache.outputs.cache-hit != 'true' && runner.os == 'Linux' | |
run: | | |
sudo apt update | |
sudo apt install libcurl4-openssl-dev | |
- run: scripts/build-sentry-native.ps1 | |
if: steps.cache.outputs.cache-hit != 'true' | |
shell: pwsh | |
build: | |
needs: build-sentry-native | |
name: .NET (${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
# Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703 | |
os: [ubuntu-latest, windows-latest, macos-15] | |
steps: | |
- name: Cancel Previous Runs | |
if: github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') | |
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # Tag: 0.12.1 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 2 # default is 1 and codecov needs > 1 | |
- name: Remove unused applications | |
uses: ./.github/actions/freediskspace | |
# We use macOS for the final publishing build so we get all the iOS/macCatalyst targets in the packages | |
- name: Set Environment Variables | |
if: runner.os == 'macOS' | |
run: echo "CI_PUBLISHING_BUILD=true" >> $GITHUB_ENV | |
- name: Download sentry-native (Linux) | |
if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (runner.os == 'Linux') }} | |
uses: actions/cache/restore@v4 | |
with: | |
path: src/Sentry/Platforms/Native/sentry-native | |
key: sentry-native-Linux-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} | |
fail-on-cache-miss: true | |
- name: Download sentry-native (macOS) | |
if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (runner.os == 'macOS') }} | |
uses: actions/cache/restore@v4 | |
with: | |
path: src/Sentry/Platforms/Native/sentry-native | |
key: sentry-native-macOS-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} | |
fail-on-cache-miss: true | |
- name: Download sentry-native (Windows) | |
if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (runner.os == 'Windows') }} | |
uses: actions/cache/restore@v4 | |
with: | |
path: src/Sentry/Platforms/Native/sentry-native | |
key: sentry-native-Windows-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} | |
fail-on-cache-miss: true | |
enableCrossOsArchive: true | |
- name: Setup Environment | |
uses: ./.github/actions/environment | |
- name: Build Native Dependencies | |
uses: ./.github/actions/buildnative | |
- name: Restore .NET Dependencies | |
run: dotnet restore Sentry-CI-Build-${{ runner.os }}.slnf --nologo | |
- name: Install Android SDKs | |
if: runner.os == 'macOS' | |
run: | | |
dotnet build src/Sentry/Sentry.csproj -t:InstallAndroidDependencies -f:net8.0-android34.0 -p:AcceptAndroidSDKLicenses=True -p:AndroidSdkPath="/usr/local/lib/android/sdk/" | |
- name: Build | |
run: dotnet build Sentry-CI-Build-${{ runner.os }}.slnf -c Release --no-restore --nologo -v:minimal -flp:logfile=build.log -p:CopyLocalLockFileAssemblies=true | |
- name: Test | |
run: dotnet test Sentry-CI-Build-${{ runner.os }}.slnf -c Release --no-build --nologo -l GitHubActions -l "trx;LogFilePrefix=testresults_${{ runner.os }}" --collect "XPlat Code Coverage" | |
- name: Upload code coverage | |
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e | |
- name: Upload build and test outputs | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: verify-test-results | |
path: "**/*.received.*" | |
# To save time and disk space, we only create and archive the Nuget packages when we're actually releasing. | |
- name: Create Nuget Packages | |
if: env.CI_PUBLISHING_BUILD == 'true' | |
run: dotnet pack Sentry-CI-Build-${{ runner.os }}.slnf -c Release --no-build --nologo | |
- name: Archive Nuget Packages | |
if: env.CI_PUBLISHING_BUILD == 'true' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.sha }} | |
if-no-files-found: error | |
path: | | |
src/**/Release/*.nupkg | |
src/**/Release/*.snupkg | |
integration-test: | |
needs: build | |
name: Integration test (${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
# Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703 | |
os: [ubuntu-latest, windows-latest, macos-15] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# We only check out what is absolutely necessary to reduce a chance of local files impacting | |
# integration tests, e.g. Directory.Build.props, nuget.config, ... | |
sparse-checkout: | | |
Directory.Build.props | |
integration-test | |
.github | |
- name: Fetch Nuget Packages | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ github.sha }} | |
path: src | |
- name: Install build dependencies | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt update | |
sudo apt install libcurl4-openssl-dev | |
- name: Setup Environment | |
uses: ./.github/actions/environment | |
- name: Test | |
uses: getsentry/github-workflows/sentry-cli/integration-test/@v2 | |
with: | |
path: integration-test | |
trim-analysis: | |
name: Trim analysis | |
runs-on: macos-15 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 2 # default is 1 and codecov needs > 1 | |
# We use macOS for the final publishing build so we get all the iOS/macCatalyst targets in the packages | |
- name: Set Environment Variables | |
run: echo "CI_PUBLISHING_BUILD=true" >> $GITHUB_ENV | |
- name: Download sentry-native (macOS) | |
uses: actions/cache/restore@v4 | |
with: | |
path: src/Sentry/Platforms/Native/sentry-native | |
key: sentry-native-macOS-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} | |
fail-on-cache-miss: true | |
- name: Setup Environment | |
uses: ./.github/actions/environment | |
- name: Build Native Dependencies | |
uses: ./.github/actions/buildnative | |
- name: Install Android SDKs | |
if: runner.os == 'macOS' | |
run: | | |
dotnet build src/Sentry/Sentry.csproj -t:InstallAndroidDependencies -f:net8.0-android34.0 -p:AcceptAndroidSDKLicenses=True -p:AndroidSdkPath="/usr/local/lib/android/sdk/" | |
- name: Publish Test app (macOS) | |
run: dotnet publish test/Sentry.TrimTest/Sentry.TrimTest.csproj -c Release -r osx-arm64 | |
- name: Publish Test app (Android) | |
run: dotnet publish test/Sentry.MauiTrimTest/Sentry.MauiTrimTest.csproj -c Release -f net9.0-android35.0 -r android-arm64 | |
# We can't publish iOS applications on CI yet. We'd need a valid bundle identifier and to install the relevant | |
# certificates/profiles on CI (presumably certs associated with the Sentry org). | |
# See https://youtrack.jetbrains.com/issue/RIDER-17115/Could-not-find-any-available-provisioning-profiles-for-iOS | |
# - name: Publish Test app (iOS) | |
# run: dotnet publish test/Sentry.MauiTrimTest/Sentry.MauiTrimTest.csproj -c Release -f net9.0-ios18.0 -r ios-arm64 | |
test-solution-filters: | |
runs-on: ubuntu-latest | |
if: ${{ !startsWith(github.ref_name, 'release/') }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Rebuild Solution Filters | |
shell: pwsh | |
run: pwsh scripts/generate-solution-filters.ps1 | |
- name: Ensure Solution Filters are up to date | |
shell: pwsh | |
run: scripts/dirty-check.ps1 -PathToCheck ./*.sln* -GuidanceOnFailure "Uncommitted changes to the solution filters detected. Run `scripts/generate-solution-filters.ps1` locally and commit changes." |