Maximum compression of artifacts #91
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
paths: | |
- '**.hpp' | |
- '**.h' | |
- '**.cpp' | |
- '**.c' | |
- '**.cmake' | |
- '**.txt' | |
- '.github/workflows/build.yml' | |
workflow_dispatch: | |
env: | |
GIT_BRANCH: ${{ github.ref_type == 'branch' && github.ref_name || 'release' }} | |
BUILD_TYPE: ${{ (github.ref_type != 'branch' || github.ref_name == 'main') && 'Release' || 'RelWithDebInfo' }} | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-20.04] | |
arch: [x64, x86] | |
include: | |
- os: windows-latest | |
arch: x64 | |
CMAKE_ARCH_FLAG: -A x64 | |
- os: windows-latest | |
arch: x86 | |
CMAKE_ARCH_FLAG: -A Win32 | |
- os: ubuntu-20.04 | |
arch: x86 | |
CMAKE_ARCH_FLAG: -DCMAKE_C_FLAGS="-m32" -DCMAKE_CXX_FLAGS="-m32" | |
- os: macos-latest | |
arch: x64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Install dependencies Ubuntu x86 | |
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.arch == 'x86' }} | |
run: | | |
sudo apt update | |
sudo apt install gcc-multilib g++-multilib | |
- name: Download garrysmod_common | |
uses: actions/checkout@v4 | |
with: | |
repository: dankmolot/garrysmod_common | |
ref: ${{ matrix.arch == 'x64' && 'x86-64-cmake' || 'master-cmake' }} | |
submodules: recursive | |
path: third-party/garrysmod_common | |
- name: Configure project | |
run: cmake -B build -S . ${{matrix.CMAKE_ARCH_FLAG}} -DGARRYSMOD_COMMON_PATH="third-party/garrysmod_common" -DAUTOINSTALL="." -DBUILD_SHARED_LIBS=OFF -DGIT_BRANCH="${{env.GIT_BRANCH}}" -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" | |
- name: Build project | |
run: cmake --build build -j -t moonloader --config ${{env.BUILD_TYPE}} | |
- name: "Upload artifacts" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: moonloader-${{matrix.os}}-${{matrix.arch}}-${{env.BUILD_TYPE}} | |
path: | | |
./*.dll | |
./*.pdb | |
if-no-files-found: error | |
compression-level: 9 | |
retention-days: 14 |