-
Notifications
You must be signed in to change notification settings - Fork 4
146 lines (126 loc) · 4.39 KB
/
build.yml
File metadata and controls
146 lines (126 loc) · 4.39 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
name: Check-Build
on: [push]
jobs:
build-driver:
name: Build C++ driver (${{ matrix.os }} • ${{ matrix.preset }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Windows release presets
- os: windows-latest
preset: x64-release
triplet: x64-windows-static
vcpkgPkgs: "capnproto minhook"
use_hooks: "ON"
- os: windows-latest
preset: x64-release-nohooks
triplet: x64-windows-static
vcpkgPkgs: "capnproto"
use_hooks: "OFF"
# Linux release preset
- os: ubuntu-latest
preset: linux-x64-release
triplet: x64-linux
vcpkgPkgs: "capnproto"
use_hooks: "OFF"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Set up Ninja (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y ninja-build
- name: Set up Ninja (cross-platform)
uses: seanmiddleditch/gha-setup-ninja@v4
- name: Set up MSVC developer command prompt (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: Set up CMake
uses: lukka/get-cmake@latest
- name: Set up vcpkg
id: runvcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: 0d9d4684352ba8de70bdf251c6fc9a3c464fa12b
- name: Install vcpkg packages (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$triplet = '${{ matrix.triplet }}'
$pkgsRaw = '${{ matrix.vcpkgPkgs }}'
$pkgs = $pkgsRaw -split '\s+' | Where-Object { $_ -and $_.Trim().Length -gt 0 }
[string[]]$vcpkgArgs = @()
foreach ($p in $pkgs) { $vcpkgArgs += ("$($p.Trim()):$triplet") }
if ($vcpkgArgs.Count -eq 0) { Write-Host 'No vcpkg packages to install.' } else { & "$env:VCPKG_ROOT\vcpkg.exe" install @vcpkgArgs }
- name: Install vcpkg packages (Linux)
if: runner.os == 'Linux'
shell: bash
run: |
set -euo pipefail
triplet='${{ matrix.triplet }}'
pkgs='${{ matrix.vcpkgPkgs }}'
args=""
for p in $pkgs; do args+="$p:$triplet "; done
"$VCPKG_ROOT/vcpkg" install $args
- name: Configure (CMake preset)
working-directory: ${{ github.workspace }}
run: >-
cmake
--preset "${{ matrix.preset }}"
-DCMAKE_TOOLCHAIN_FILE="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake"
-DUSE_HOOKS=${{ matrix.use_hooks }}
- name: Build (CMake preset)
working-directory: ${{ github.workspace }}
run: cmake --build "out/build/${{ matrix.preset }}" --parallel
- name: Upload driver pack artifact
uses: actions/upload-artifact@v4
with:
name: driver_${{ matrix.preset }}_${{ runner.os }}
path: |
out/build/${{ matrix.preset }}/driver_Amethyst/Pack/**
if-no-files-found: error
package-all:
name: Package plugin
needs: build-driver
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Download all driver artifacts
uses: actions/download-artifact@v4
with:
pattern: driver_*
path: drivers
merge-multiple: true
- name: Set up .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: "10.0.x"
- name: Restore and build (publish)
run: dotnet publish /p:Configuration=Release /p:TargetFramework=net8.0 /p:PublishProfile=FolderProfile
- name: Pack published files
run: |
cd plugin_OpenVR/bin/Release/publish
7z a plugin_OpenVR.zip *
- name: Upload plugin artifact
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "ame2-latest"
prerelease: true
title: "plugin_OpenVR Build Artifact"
files: |
./plugin_OpenVR/bin/Release/publish/plugin_OpenVR.zip
./external/manifest.json
- uses: geekyeggo/delete-artifact@v5
with:
failOnError: false
name: |
driver_*