-
-
Notifications
You must be signed in to change notification settings - Fork 60
160 lines (141 loc) · 6.5 KB
/
Copy pathsdk.yml
File metadata and controls
160 lines (141 loc) · 6.5 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Select submodules
id: env
shell: bash
run: |
if [[ "${TARGET}" == "Android" ]]; then
# Android needs sentry-native too — BuildAndroidSDK builds the NDK from source.
submodules="modules/sentry-java modules/sentry-native"
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@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
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', 'build/native-sdks.targets', 'sdk-static/**', 'scripts/build-cocoa-sdk.ps1', 'scripts/build-native-ndk-local.ps1') }}
- name: Installing Linux Dependencies
if: ${{ (env.TARGET == 'Linux' || env.TARGET == 'LinuxNative') && 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@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ env.TARGET == 'MacOSNative' }}
with:
name: ${{ env.TARGET }}-sdk
path: package-dev/Plugins/macOS/SentryNative~
# Lower retention period - we only need this to retry CI.
retention-days: 14
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ env.TARGET == 'Windows' }}
with:
name: ${{ env.TARGET }}-sdk
path: package-dev/Plugins/Windows/Sentry~
# Lower retention period - we only need this to retry CI.
retention-days: 14
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ env.TARGET == 'WindowsNative' }}
with:
name: ${{ env.TARGET }}-sdk
path: package-dev/Plugins/Windows/SentryNative~
# Lower retention period - we only need this to retry CI.
retention-days: 14
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ env.TARGET == 'Linux' }}
with:
name: ${{ env.TARGET }}-sdk
path: package-dev/Plugins/Linux/Sentry~
# Lower retention period - we only need this to retry CI.
retention-days: 14
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ env.TARGET == 'LinuxNative' }}
with:
name: ${{ env.TARGET }}-sdk
path: package-dev/Plugins/Linux/SentryNative~
# Lower retention period - we only need this to retry CI.
retention-days: 14
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ env.TARGET != 'Cocoa' && env.TARGET != 'MacOSNative' && env.TARGET != 'Windows' && env.TARGET != 'WindowsNative' && env.TARGET != 'Linux' && env.TARGET != 'LinuxNative' }}
with:
name: ${{ env.TARGET }}-sdk
path: package-dev/Plugins/${{ env.TARGET }}
# Lower retention period - we only need this to retry CI.
retention-days: 14