-
-
Notifications
You must be signed in to change notification settings - Fork 60
119 lines (105 loc) · 4.47 KB
/
sdk.yml
File metadata and controls
119 lines (105 loc) · 4.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: "Build native SDKs"
on:
workflow_call:
inputs:
runsOn:
required: true
type: string
target:
required: true
type: string
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
TARGET: ${{ inputs.target }}
jobs:
build:
runs-on: ${{ inputs.runsOn }}
timeout-minutes: 30
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- name: Select submodules
id: env
shell: bash
run: |
if [[ "${TARGET}" == "Android" ]]; then
submodules="modules/sentry-java"
elif [[ "${TARGET}" == "Cocoa" ]]; then
submodules="modules/sentry-cocoa"
else
submodules="modules/sentry-native"
fi
echo "submodulesPath=$submodules" >> $GITHUB_OUTPUT
echo "submodules=src/sentry-dotnet $submodules" >> $GITHUB_OUTPUT
- name: Get submodule status
run: git submodule status --cached $SUBMODULES | tee submodules-status
shell: bash
env:
SUBMODULES: ${{ steps.env.outputs.submodules }}
- name: Update submobules
run: git submodule update --init --recursive ${{ steps.env.outputs.submodules }}
- run: |
if [[ "${{ env.TARGET }}" == "Cocoa" ]]; then
cp -r package-dev/Plugins/iOS sdk-static/ || echo "never mind, no iOS files checked in..."
cp -r package-dev/Plugins/macOS sdk-static/ || echo "never mind, no macOS files checked in..."
else
cp -r package-dev/Plugins/${{ env.TARGET }} sdk-static || echo "never mind, no files checked in..."
fi
shell: bash
- name: Restore from cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
id: cache
with:
# Note: native SDKs are cached and only built if the respective 'package-dev/Plugins/' directories are empty.
# Output changes only depending on the git sha of the submodules
# hash of package/package.json for cache busting on release builds (version bump)
path: |
package-dev/Plugins
key: sdk=${{ env.TARGET }}-${{ hashFiles('submodules-status', 'package/package.json', 'Directory.Build.targets', 'sdk-static/**', 'scripts/build-cocoa-sdk.ps1') }}
- name: Installing Linux Dependencies
if: ${{ env.TARGET == 'Linux' && steps.cache.outputs.cache-hit != 'true' }}
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y zlib1g-dev libcurl4-openssl-dev libssl-dev build-essential cmake curl
set -eo pipefail
curl -sSL --retry 5 https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 9.0 --install-dir /usr/share/dotnet
echo "/usr/share/dotnet" >> $GITHUB_PATH
env:
DEBIAN_FRONTEND: noninteractive
- name: Install .NET SDK
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5
with:
global-json-file: global.json
- name: Restore .NET Workload
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: dotnet workload restore
- name: Build
if: steps.cache.outputs.cache-hit != 'true'
run: dotnet msbuild /t:Build${{ env.TARGET }}SDK /p:Configuration=Release /p:OutDir=other src/Sentry.Unity
- name: Upload build logs on failure
if: ${{ failure() }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
path: |
${{ steps.env.outputs.submodulesPath }}/build.log
modules/sentry-cocoa/*.log
# Lower retention period - we only need this to retry CI.
retention-days: 14
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: ${{ env.TARGET == 'Cocoa' }}
with:
name: ${{ env.TARGET }}-sdk
path: |
package-dev/Plugins/iOS/Sentry.xcframework~
package-dev/Plugins/macOS/Sentry
# Lower retention period - we only need this to retry CI.
retention-days: 14
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: ${{ env.TARGET != 'Cocoa' }}
with:
name: ${{ env.TARGET }}-sdk
path: package-dev/Plugins/${{ env.TARGET }}
# Lower retention period - we only need this to retry CI.
retention-days: 14