Add build script #15
Workflow file for this run
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: CI | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
# Run GitHub Actions monthly to make sure CI isn't broken and downloads don't expire | |
schedule: | |
- cron: '0 0 1 * *' | |
env: | |
# Path to the solution file relative to the root of the project. | |
SOLUTION_FILE_PATH: msvc/weaponmod.sln | |
# Configuration type to build. | |
# You can convert this to a build matrix if you need coverage of multiple configuration types. | |
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | |
BUILD_CONFIGURATION: Release | |
jobs: | |
linux: | |
name: Linux-x86 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Save Git info into variables | |
id: vars | |
shell: bash | |
run: | | |
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | |
- name: Update system | |
run: sudo apt update | |
- name: Install G++ (multilib) | |
run: sudo apt install -y g++-multilib | |
- name: Build | |
run: CFG=${{env.BUILD_CONFIGURATION}} make | |
- name: Deploy | |
uses: actions/[email protected] | |
with: | |
name: weaponmod-linux-${{ steps.vars.outputs.sha_short }} | |
path: | | |
Release/weaponmod_amxx_i386.so | |
win32: | |
name: Win32 | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Save Git info into variables | |
id: vars | |
shell: bash | |
run: | | |
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | |
- name: Add MSBuild to PATH | |
uses: microsoft/setup-msbuild@v1 | |
- name: Build | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
# Add additional options to the MSBuild command line here (like platform or verbosity level). | |
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference | |
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} | |
- name: Upload build result | |
uses: actions/upload-artifact@v2 | |
with: | |
name: weaponmod-windows-${{ steps.vars.outputs.sha_short }} | |
path: | | |
msvc/Release/weaponmod_amxx.dll | |
msvc/Release/weaponmod_amxx.pdb |