-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (76 loc) · 2.41 KB
/
Copy pathcpp_build.yml
File metadata and controls
92 lines (76 loc) · 2.41 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
name: C++ SDK Build
on:
push:
permissions:
contents: read
jobs:
build:
name: ${{ matrix.rid }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
rid: win-x64
architecture: x64
upload_sdk: "false"
- os: ubuntu-latest
rid: linux-x64
architecture: x64
upload_sdk: "true"
- os: macos-latest
rid: osx-arm64
architecture: arm64
upload_sdk: "false"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Setup CMake
uses: lukka/get-cmake@latest
- name: Build and package C++ SDK
if: matrix.upload_sdk == 'true'
shell: pwsh
run: >
./src/cpp/build.ps1
-Configuration Release
-Architecture ${{ matrix.architecture }}
-Generator Ninja
- name: Build C++ SDK
if: matrix.upload_sdk != 'true'
shell: pwsh
run: >
./src/cpp/build.ps1
-Configuration Release
-Architecture ${{ matrix.architecture }}
-Generator Ninja
-SkipPackage
- name: Stage C++ SDK artifact
if: matrix.upload_sdk == 'true'
shell: pwsh
run: |
$buildDir = "src/cpp/build/${{ matrix.rid }}"
$stagingDir = "src/cpp/build/artifacts/pixeval-cpp-sdk"
if (Test-Path -LiteralPath $stagingDir) {
Remove-Item -LiteralPath $stagingDir -Recurse -Force
}
New-Item -ItemType Directory -Force -Path $stagingDir | Out-Null
$package = Get-ChildItem -LiteralPath $buildDir -File -Filter "pixeval-extensions-cpp-sdk-*.zip" |
Sort-Object LastWriteTime -Descending |
Select-Object -First 1
if ($null -eq $package) {
throw "C++ SDK package was not found under $buildDir"
}
Expand-Archive -LiteralPath $package.FullName -DestinationPath $stagingDir -Force
- name: Upload C++ SDK
if: matrix.upload_sdk == 'true'
uses: actions/upload-artifact@v4
with:
name: pixeval-cpp-sdk
path: src/cpp/build/artifacts/pixeval-cpp-sdk/**
if-no-files-found: error
retention-days: 90