forked from getsentry/sentry-unity
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (68 loc) · 2.85 KB
/
sdk.yml
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
on:
workflow_call:
inputs:
runsOn:
required: true
type: string
target:
required: true
type: string
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
jobs:
build:
runs-on: ${{ inputs.runsOn }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- name: Select submodules
id: env
shell: bash
run: |
if [[ "${{ inputs.target }}" == "Android" ]]; then
submodules="modules/sentry-java"
elif [[ "${{ inputs.target }}" == "iOS" || "${{ inputs.target }}" == "macOS" ]]; then
submodules="modules/sentry-cocoa"
else
submodules="modules/sentry-native"
fi
echo "submodules=src/sentry-dotnet $submodules" >> $GITHUB_OUTPUT
- name: Get submodule status
run: git submodule status --cached ${{ steps.env.outputs.submodules }} | tee submodules-status
- run: cp -r package-dev/Plugins/${{ inputs.target }} sdk-static || echo "never mind, no files checked in..."
shell: bash
- name: Restore from cache
uses: actions/cache@v3
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
modules/sentry-java/sentry-android-ndk/build/intermediates/merged_native_libs/release/out/lib
key: sdk=${{ inputs.target }}-${{ hashFiles('submodules-status', 'package/package.json', 'Directory.Build.targets', 'sdk-static/**') }}
- name: Installing Linux Dependencies
if: ${{ inputs.target == 'Linux' && steps.cache.outputs.cache-hit != 'true' }}
run: |
sudo apt-get update
sudo apt-get install zlib1g-dev libcurl4-openssl-dev libssl-dev
- name: Build
if: steps.cache.outputs.cache-hit != 'true'
run: |
git submodule update --init --recursive ${{ steps.env.outputs.submodules }}
dotnet msbuild /t:Build${{ inputs.target }}SDK /p:Configuration=Release /p:OutDir=other src/Sentry.Unity
- uses: actions/upload-artifact@v3
with:
name: ${{ inputs.target }}-sdk
path: package-dev/Plugins/${{ inputs.target }}
# Lower retention period - we only need this to retry CI.
retention-days: 14
- uses: actions/upload-artifact@v3
if: ${{ inputs.target == 'Android' }}
with:
name: ${{ inputs.target }}-libraries
path: modules/sentry-java/sentry-android-ndk/build/intermediates/merged_native_libs/release/out/lib/*
# Lower retention period - we only need this to retry CI.
retention-days: 14