Skip to content

CI: Set C compiler

CI: Set C compiler #18

Workflow file for this run

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