-
Notifications
You must be signed in to change notification settings - Fork 13
41 lines (41 loc) · 1.54 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
name: Build
on: [push]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install deps
run: sudo apt-get install -y git cmake zip libc++1-12 libc++abi-12-dev libc++-12-dev libc++abi1-12
- name: Retrieve version
run: |
echo "TAG_NAME=$(cat CMakeLists.txt | grep -Po '(?<=MODLOADER_VERSION \")[^\"]+')" >> $GITHUB_OUTPUT
id: version
- name: Build
run: mkdir build && cd build && cmake -DCMAKE_C_COMPILER=clang-12 -DCMAKE_CXX_COMPILER=clang++-12 -DCMAKE_INSTALL_PREFIX=../sdk/ .. && make && make install && cd ..
- name: Pack the SDK and modloader
run: |
mkdir artifacts && cd sdk &&
zip -r ../artifacts/mod_sdk.zip . && cp lib/libserver_modloader.so ../artifacts && cd ..
- name: Artifact - libserver_modloader.so
uses: actions/upload-artifact@v3
with:
name: libserver_modloader.so
path: artifacts/libserver_modloader.so
- name: Artifact - mod_sdk.zip
uses: actions/upload-artifact@v3
with:
name: mod_sdk.zip
path: artifacts/mod_sdk.zip
- name: Update release
uses: softprops/action-gh-release@v1
if: startsWith(github.event.head_commit.message, '[Release]')
with:
draft: true
tag_name: ${{ steps.version.outputs.TAG_NAME }}
files: |
artifacts/libserver_modloader.so
artifacts/mod_sdk.zip