Skip to content

Init

Init #129

Workflow file for this run

name: CMake
on: [push, pull_request]
jobs:
build_linux:
runs-on: ubuntu-latest
container: s1lentq/linux86buildtools:latest
env:
CMAKE_TOOLCHAIN_FILE: ${{github.workspace}}/cmake/linux-i686.cmake
steps:
- uses: actions/checkout@v2
- name: Configure CMake
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: rm -rf build && CC=icc CXX=icpc cmake -B build -DCMAKE_TOOLCHAIN_FILE=cmake/linux-i686.cmake && cmake --build build -j
- name: Deploy artifacts
uses: actions/upload-artifact@v2
with:
name: linux
path: ${{github.workspace}}/bin/Release/voice_utils_amxx_i386.so
build_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
-
name: Install ninja
run: choco install ninja
- name: setup devcmd
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86
- name: Configure CMake
working-directory: ${{github.workspace}}
run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="cmake/win32-msvc-xp-static-ipo.cmake"
- name: Build
working-directory: ${{github.workspace}}
run: cmake --build build --config Release --parallel
- name: Deploy artifacts
uses: actions/upload-artifact@v2
with:
name: windows
path: ${{github.workspace}}/bin/Release/voice_utils_amxx.dll
publish:
name: 'Publish'
runs-on: ubuntu-latest
needs: [build_windows, build_linux]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Deploying linux artifacts
uses: actions/download-artifact@v2
with:
name: linux
- name: Deploying windows artifacts
uses: actions/download-artifact@v2
with:
name: windows
- name: Archive artifacts
run: |
mkdir -p addons/amxmodx/modules addons/amxmodx/scripting
cp voice_utils_amxx.dll voice_utils_amxx_i386.so addons/amxmodx/modules
cp scripting/voiceutils.inc addons/amxmodx/scripting
7z a -tzip voice_utils-bin-${RELEASE_VERSION}.zip addons
- name: Release
uses: softprops/action-gh-release@v1
with:
files: voice_utils-bin-*.zip