-
Notifications
You must be signed in to change notification settings - Fork 6
93 lines (80 loc) · 2.61 KB
/
build.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: "Build"
on:
workflow_dispatch:
workflow_call:
push:
tags:
- v*
branches:
- main
paths-ignore:
- "**.md"
jobs:
native-job:
name: "Build native libraries: ${{ matrix.platform.rid }}"
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- { name: Windows (x64), os: windows-2022, rid: win-x64 }
- { name: macOS (x64 + arm64), os: macos-13, rid: osx }
- { name: Linux (x64), os: ubuntu-20.04, rid: linux-x64 }
steps:
- name: "Clone Git repository"
uses: actions/checkout@master
with:
submodules: "recursive"
- name: "Install C2CS"
shell: bash
run: dotnet tool install --global bottlenoselabs.C2CS.Tool
- name: "Get C2CS version"
shell: bash
run: echo "C2CS_VERSION=$(c2cs --version)" >> $GITHUB_ENV
- name: "Cache native libraries"
id: cache-libs
uses: actions/cache@v3
with:
path: "./lib"
key: "libs-${{ matrix.platform.rid }}-${{ hashFiles('ext/Tracy/**/*') }}-${{ hashFiles('src/c/**/*') }}-${{ hashFiles('bindgen/**/*') }}-${{ env.C2CS_VERSION }}"
- name: "Build native libraries"
if: steps.cache-libs.outputs.cache-hit != 'true'
shell: bash
run: ./library.sh "auto"
- name: "Upload native libraries"
uses: actions/upload-artifact@v4
with:
path: "./lib"
name: "native-libraries-${{ matrix.platform.rid }}"
dotnet-job:
name: "Build .NET solution"
needs: [native-job]
runs-on: ubuntu-20.04
steps:
- name: "Clone Git repository"
uses: actions/checkout@master
with:
submodules: "true"
- name: "Download native libraries (win-x64)"
uses: actions/download-artifact@v4
with:
name: "native-libraries-win-x64"
path: "./lib"
- name: "Download native libraries (osx)"
uses: actions/download-artifact@v4
with:
name: "native-libraries-osx"
path: "./lib"
- name: "Download native libraries (linux-x64)"
uses: actions/download-artifact@v4
with:
name: "native-libraries-linux-x64"
path: "./lib"
- name: "Download generated C# code"
uses: actions/download-artifact@v4
continue-on-error: true
with:
name: "bindgen-cs"
path: "./src/cs/production/Tracy/Generated"
- name: ".NET Build"
run: dotnet build "./src/cs" --nologo --verbosity minimal --configuration Release -p:PackageVersion="$(date +'%Y.%m.%d')"