-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (54 loc) · 1.98 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
61
62
63
64
65
66
67
name: Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
configuration: [Release, Debug]
env:
PROJECT_NAME: BallanceModLoaderPlus
BASE_BUILD_DIR: ${{ github.workspace }}/build
BASE_DIST_DIR: ${{ github.workspace }}/dist
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Checkout Virtools SDK
uses: actions/checkout@v4
with:
repository: doyaGu/Virtools-SDK-2.1
path: ${{ github.workspace }}/Virtools-SDK-2.1
- name: Get current branch and commit hash
shell: bash
run: |
echo "GIT_BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> "$GITHUB_ENV"
echo "GIT_SHA=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
- name: Setup CMake
uses: lukka/get-cmake@latest
- name: Setup MSVC
uses: TheMrMilchmann/[email protected]
with:
arch: x86
- name: Configure CMake
run: >
cmake -A Win32 -B ${{ env.BASE_BUILD_DIR }}/${{ matrix.configuration }}
-DCMAKE_BUILD_TYPE=${{ matrix.configuration }}
-DVIRTOOLS_SDK_PATH=${{ github.workspace }}/Virtools-SDK-2.1
-DCMAKE_INSTALL_PREFIX=${{ env.BASE_DIST_DIR }}/${{ matrix.configuration }}
- name: Build the project
run: cmake --build ${{ env.BASE_BUILD_DIR }}/${{ matrix.configuration }} --config ${{ matrix.configuration }}
- name: Install binaries to distribution folder
run: >
cmake --install ${{ env.BASE_BUILD_DIR }}/${{ matrix.configuration }}
--prefix ${{ env.BASE_DIST_DIR }}/${{ matrix.configuration }} --config ${{ matrix.configuration }}
- name: Upload build artifacts
uses: actions/[email protected]
with:
name: ${{ env.PROJECT_NAME }}-${{ env.GIT_SHA }}-${{ matrix.configuration }}
path: ${{ env.BASE_DIST_DIR }}/${{ matrix.configuration }}