-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (50 loc) · 1.63 KB
/
build.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
name: C++ CI Build with Enhanced Windows Support
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
include:
- os: ubuntu-latest
name: "Linux x64"
asset_name: "MCRandomProxy-Linux"
cc: "gcc"
cxx: "g++"
- os: windows-latest
name: "Windows MSVC"
asset_name: "MCRandomProxy-Windows.exe"
cc: "cl"
cxx: "cl"
build_env_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up environment (Windows)
if: matrix.os == 'windows-latest'
run: |
cmd "${{ matrix.build_env_script }}"
- name: Install dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y g++ cmake make
- name: Install dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
choco install ninja cmake --version=3.21.3
choco install visualstudio2019buildtools --includeOptional
- name: Configure CMake
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -G "Ninja"
- name: Build
run: cmake --build build --config Release
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.asset_name }}
path: ./build/${{ matrix.asset_name }}