Skip to content

Commit 14bdac4

Browse files
Merge branch 'main' into version-5.0.0
2 parents cef53ef + b478665 commit 14bdac4

File tree

6 files changed

+54
-35
lines changed

6 files changed

+54
-35
lines changed

.github/actions/environment/action.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,35 @@ runs:
2222
with:
2323
log-accepted-android-sdk-licenses: false
2424

25+
# https://github.com/actions/runner-images/issues/10814
26+
- name: Workaround build-tools issue
27+
if: runner.os == 'macOS'
28+
shell: bash
29+
run: |
30+
curl https://dl.google.com/android/repository/build-tools_r35_macosx.zip > $ANDROID_HOME/build-tools_r35_macosx.zip
31+
cd $ANDROID_HOME
32+
mkdir -p build-tools
33+
unzip build-tools_r35_macosx.zip
34+
mv android-15 build-tools/35.0.0
35+
cd -
36+
2537
- name: Set Java Version
2638
uses: actions/setup-java@v3
2739
with:
2840
distribution: 'temurin'
2941
java-version: '11'
3042

31-
# .NET 6 and .NET 8 are not built-in with macos-13
43+
- name: Install Mono
44+
if: runner.os == 'macOS'
45+
shell: bash
46+
# Attempt to install Mono, allowing it to fail silently
47+
# Then ensure mono is correctly linked, overwriting any conflicting symlinks
48+
run: |
49+
brew install mono || true
50+
brew link --overwrite mono
51+
3252
- name: Install .NET SDK
53+
if: runner.os != 'Windows'
3354
uses: actions/setup-dotnet@v4
3455
with:
3556
dotnet-version: |

.github/workflows/build.yml

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
os: [ubuntu-latest, windows-latest, macos-latest]
22+
# Pin macos to get the version of XCode that we need: https://github.com/actions/runner-images/issues/10703
23+
os: [ubuntu-latest, windows-latest, macos-15]
2324

2425
steps:
2526
- name: Checkout
@@ -55,7 +56,8 @@ jobs:
5556
strategy:
5657
fail-fast: false
5758
matrix:
58-
os: [ubuntu-latest, windows-latest, macos-latest]
59+
# Pin macos to get the version of XCode that we need: https://github.com/actions/runner-images/issues/10703
60+
os: [ubuntu-latest, windows-latest, macos-15]
5961

6062
steps:
6163
- name: Cancel Previous Runs
@@ -79,7 +81,7 @@ jobs:
7981

8082
# We use macOS for the final publishing build so we get all the iOS/macCatalyst targets in the packages
8183
- name: Set Environment Variables
82-
if: startsWith(matrix.os, 'macos')
84+
if: runner.os == 'macOS'
8385
run: echo "CI_PUBLISHING_BUILD=true" >> $GITHUB_ENV
8486

8587
- name: Download sentry-native (Linux)
@@ -116,6 +118,12 @@ jobs:
116118
- name: Restore .NET Dependencies
117119
run: dotnet restore Sentry-CI-Build-${{ runner.os }}.slnf --nologo
118120

121+
- name: Install Android SDKs
122+
if: runner.os == 'macOS'
123+
run: |
124+
dotnet build src/Sentry/Sentry.csproj -t:InstallAndroidDependencies -f:net7.0-android -p:AcceptAndroidSDKLicenses=True -p:AndroidSdkPath="/usr/local/lib/android/sdk/"
125+
dotnet build src/Sentry/Sentry.csproj -t:InstallAndroidDependencies -f:net8.0-android -p:AcceptAndroidSDKLicenses=True -p:AndroidSdkPath="/usr/local/lib/android/sdk/"
126+
119127
- name: Build
120128
run: dotnet build Sentry-CI-Build-${{ runner.os }}.slnf -c Release --no-restore --nologo -v:minimal -flp:logfile=build.log -p:CopyLocalLockFileAssemblies=true
121129

@@ -156,7 +164,8 @@ jobs:
156164
strategy:
157165
fail-fast: false
158166
matrix:
159-
os: [ubuntu-latest, windows-latest, macos-latest]
167+
# Pin macos to get the version of XCode that we need: https://github.com/actions/runner-images/issues/10703
168+
os: [ubuntu-latest, windows-latest, macos-15]
160169

161170
steps:
162171
- uses: actions/checkout@v4
@@ -166,6 +175,7 @@ jobs:
166175
sparse-checkout: |
167176
Directory.Build.props
168177
integration-test
178+
.github
169179
- name: Fetch Nuget Packages
170180
uses: actions/download-artifact@v4
171181
with:
@@ -178,30 +188,8 @@ jobs:
178188
sudo apt update
179189
sudo apt install libcurl4-openssl-dev
180190
181-
# Possibly instead of installing net9.0 here we could pin the workload version when installing workloads
182-
- uses: actions/setup-dotnet@v4
183-
with:
184-
dotnet-version: |
185-
8.0.x
186-
9.0.100-rc.2.24474.11
187-
188-
- name: Setup Xcode
189-
if: matrix.os == 'macos-latest'
190-
run: |
191-
sudo xcode-select --switch /Applications/Xcode_${{env.XCODE_VERSION}}.app/Contents/Developer
192-
xcodebuild -version
193-
194-
# Needed for Android SDK setup step
195-
- uses: actions/setup-java@v4
196-
with:
197-
distribution: 'temurin'
198-
java-version: '17'
199-
200-
- name: Setup Android SDK
201-
uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3.2.2
202-
203-
- name: Install android Workloads
204-
run: dotnet workload install maui-android
191+
- name: Setup Environment
192+
uses: ./.github/actions/environment
205193

206194
- name: Test
207195
uses: getsentry/github-workflows/sentry-cli/integration-test/@v2

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
uses: ./.github/actions/environment
3636

3737
- name: Initialize CodeQL
38-
uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # pin@v2
38+
uses: github/codeql-action/init@4f3212b61783c3c68e8309a0f18a699764811cda # pin@v2
3939
with:
4040
languages: csharp
4141

@@ -49,6 +49,6 @@ jobs:
4949
run: dotnet build Sentry-CI-CodeQL.slnf --no-restore --nologo
5050

5151
- name: Perform CodeQL Analysis
52-
uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # pin@v2
52+
uses: github/codeql-action/analyze@4f3212b61783c3c68e8309a0f18a699764811cda # pin@v2
5353
with:
5454
category: '/language:csharp'

.github/workflows/format-code.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ on:
1010
jobs:
1111
format-code:
1212
name: Format Code
13-
# Running on 'macos' because Linux is missing the `ios` workload
14-
# See: https://github.com/dotnet/runtime/issues/85505
15-
runs-on: macos-latest
13+
# Run on 'macos' because Linux is missing the `ios` workload: https://github.com/dotnet/runtime/issues/85505
14+
# Pin macos to get the version of XCode that we need: https://github.com/actions/runner-images/issues/10703
15+
runs-on: macos-15
1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@v4

.github/workflows/vulnerabilities.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ on:
1010
jobs:
1111
list-vulnerable-packages:
1212
name: List vulnerable packages
13-
runs-on: macos-latest
13+
# Pin macos to get the version of XCode that we need: https://github.com/actions/runner-images/issues/10703
14+
runs-on: macos-15
1415

1516
steps:
1617
- name: Checkout

integration-test/cli.Tests.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,15 @@ Describe 'MAUI' -ForEach @(
141141
}
142142

143143
AddPackageReference $name 'Sentry.Maui'
144+
145+
if (Test-Path env:CI)
146+
{
147+
dotnet build $name/$name.csproj -t:InstallAndroidDependencies -f:$framework-android -p:AcceptAndroidSDKLicenses=True -p:AndroidSdkPath="/usr/local/lib/android/sdk/" | ForEach-Object { Write-Host $_ }
148+
if ($LASTEXITCODE -ne 0)
149+
{
150+
throw "Failed to install android dependencies."
151+
}
152+
}
144153
}
145154

146155
It "uploads symbols and sources for an Android build" {

0 commit comments

Comments
 (0)