-
Notifications
You must be signed in to change notification settings - Fork 29
101 lines (87 loc) · 2.96 KB
/
build.yaml
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
name: Build
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
build-type: [release]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libx11-dev \
libxcursor-dev \
libxinerama-dev \
libxi-dev \
libxrandr-dev \
libgl1-mesa-dev \
libncurses5
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2
with:
env: true
version: 17
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
with:
version: 1.12.1
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
export CC=clang++ CXX=clang++
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: "cd124b84feb0c02a24a2d90981e8358fdee0e077"
- name: Select CMake Preset
id: select-preset
shell: bash
run: |
if [ "${{ runner.os }}" == "Windows" ]; then
case "${{ matrix.build-type }}" in
debug) echo "preset=win-debug" ;;
release) echo "preset=win-release" ;;
relwithdebinfo) echo "preset=win-relwithdebinfo" ;;
esac
else
case "${{ matrix.build-type }}" in
debug) echo "preset=unix-debug" ;;
release) echo "preset=unix-release" ;;
relwithdebinfo) echo "preset=unix-relwithdebinfo" ;;
esac
fi | tee -a $GITHUB_OUTPUT
- name: Use Developer Command Prompt for Microsoft Visual C++
uses: ilammy/msvc-dev-cmd@v1
- name: Configure CMake
run: cmake --preset ${{ steps.select-preset.outputs.preset }}
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
- name: Build
run: cmake --build . --preset ${{ steps.select-preset.outputs.preset }} -v
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
- name: Upload Binaries
uses: actions/upload-artifact@v3
with:
name: Blur
path: |
${{ runner.os == 'Windows' && 'bin/Release/blur-cli.exe' || 'bin/Release/blur-cli' }}
${{ runner.os == 'Windows' && 'bin/Release/blur.exe' || 'bin/Release/blur' }}
- name: Release
uses: softprops/action-gh-release@v1
if: ${{ env.is_tag == 'true' }}
with:
files: |
${{ runner.os == 'Windows' && 'bin/Release/blur-cli.exe' || 'bin/Release/blur-cli' }}
${{ runner.os == 'Windows' && 'bin/Release/blur.exe' || 'bin/Release/blur' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}