-
Notifications
You must be signed in to change notification settings - Fork 1.1k
95 lines (80 loc) · 3.07 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
85
86
87
88
89
90
91
92
93
94
95
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: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: cpp
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
queries: +security-extended,security-and-quality
if: ${{ matrix.os == 'ubuntu' && matrix.buildtype == 'Debug' }}
- name: Get latest CMake
# Using 'latest' branch, the latest CMake is installed.
uses: lukka/get-cmake@latest
- 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
configurePresetAdditionalArgs: "['-DUSE_LUAJIT=${{ matrix.luajit }}']"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:cpp"
if: ${{ matrix.os == 'ubuntu' && matrix.buildtype == 'Debug' }}
- 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/${{ matrix.buildtype }}/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/${{ matrix.buildtype }}/tfs.exe
${{ runner.workspace }}/build/${{ matrix.buildtype }}/*.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 }}