-
Notifications
You must be signed in to change notification settings - Fork 1k
84 lines (70 loc) · 2.38 KB
/
build-vcpkg.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
name: Build with vcpkg
on:
push:
branches:
- master
- v*
paths:
- .github/workflows/build-vcpkg.yml
- cmake/**
- src/**
- CMakeLists.txt
- CMakePresets.json
- vcpkg.json
pull_request:
paths:
- .github/workflows/build-vcpkg.yml
- cmake/**
- src/**
- CMakeLists.txt
- CMakePresets.json
- vcpkg.json
jobs:
build-vcpkg:
name: ${{ matrix.os }}-${{ matrix.buildtype }}-luajit=${{ matrix.luajit }}
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ubuntu, macos, windows]
buildtype: [Debug, Release]
luajit: [on, off]
env:
VCPKG_BUILD_TYPE: release
steps:
- uses: actions/checkout@v4
- name: Get latest CMake
# Using 'latest' branch, the latest CMake is installed.
uses: lukka/get-cmake@latest
- name: Enable LuaJIT
if: ${{ matrix.luajit }} == "on"
run: echo "VCPKG_FEATURE_FLAGS=luajit" >> $GITHUB_ENV
- name: Run vcpkg
uses: lukka/run-vcpkg@v11
- name: Build with CMake
uses: lukka/run-cmake@v10
with:
buildPreset: vcpkg
buildPresetAdditionalArgs: "['--config', '${{ matrix.buildtype }}']"
configurePreset: vcpkg
- name: Upload artifact binary
uses: actions/upload-artifact@v4
if: ${{ !startsWith(matrix.os, 'windows') }}
with:
name: tfs-${{ matrix.os }}-${{ matrix.buildtype }}-luajit=${{ matrix.luajit }}-${{ github.sha }}
path: ${{ runner.workspace }}/build/tfs
- name: Upload artifact binary (exe)
uses: actions/upload-artifact@v4
if: ${{ startsWith(matrix.os, 'windows') }}
with:
name: tfs-${{ matrix.os }}-${{ matrix.buildtype }}-luajit=${{ matrix.luajit }}-${{ github.sha }}
path: |
${{ runner.workspace }}/build/tfs.exe
${{ runner.workspace }}/build/*.dll
- name: Prepare datapack contents
run: find . -maxdepth 1 ! -name data ! -name config.lua.dist ! -name key.pem ! -name LICENSE ! -name README.md ! -name schema.sql -exec rm -r {} \;
shell: bash
- name: Upload datapack contents
uses: actions/upload-artifact@v4
with:
name: tfs-${{ matrix.os }}-${{ matrix.buildtype }}-luajit=${{ matrix.luajit }}-${{ github.sha }}
path: ${{ github.workspace }}