mirror of
https://github.com/Source2ZE/MovementUnlocker.git
synced 2026-09-27 20:57:04 +02:00
Add GitHub Actions CI
This commit is contained in:
parent
504f653c74
commit
4de62c0856
2 changed files with 111 additions and 1 deletions
108
.github/workflows/ci.yml
vendored
Normal file
108
.github/workflows/ci.yml
vendored
Normal file
|
|
@ -0,0 +1,108 @@
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
container: ${{ matrix.container }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [windows-2022, ubuntu-latest]
|
||||||
|
include:
|
||||||
|
- os: windows-2022
|
||||||
|
- os: ubuntu-latest
|
||||||
|
container: registry.gitlab.steamos.cloud/steamrt/sniper/platform
|
||||||
|
steps:
|
||||||
|
- name: Install apt packages
|
||||||
|
if: runner.os == 'Linux'
|
||||||
|
run: |
|
||||||
|
apt update
|
||||||
|
apt install -y git python3 python3-setuptools clang
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
path: MovementUnlocker
|
||||||
|
|
||||||
|
- name: Checkout Metamod
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: alliedmodders/metamod-source
|
||||||
|
ref: master
|
||||||
|
path: mmsource-2.0
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Checkout HL2SDK
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: alliedmodders/hl2sdk
|
||||||
|
ref: cs2
|
||||||
|
path: hl2sdk-cs2
|
||||||
|
|
||||||
|
- name: Checkout AMBuild
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: alliedmodders/ambuild
|
||||||
|
path: ambuild
|
||||||
|
|
||||||
|
- name: Install AMBuild
|
||||||
|
run: |
|
||||||
|
cd ambuild && python setup.py install && cd ..
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
working-directory: MovementUnlocker
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir build && cd build
|
||||||
|
python ../configure.py --enable-optimize --sdks cs2
|
||||||
|
ambuild
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ runner.os }}
|
||||||
|
path: MovementUnlocker/build/package
|
||||||
|
|
||||||
|
release:
|
||||||
|
name: Release
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Download artifacts
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
|
||||||
|
- name: Package
|
||||||
|
run: |
|
||||||
|
version=`echo $GITHUB_REF | sed "s/refs\/tags\///"`
|
||||||
|
ls -Rall
|
||||||
|
if [ -d "./Linux/" ]; then
|
||||||
|
cd ./Linux/
|
||||||
|
tar -czf ../${{ github.event.repository.name }}-${version}-linux.tar.gz -T <(\ls -1)
|
||||||
|
cd -
|
||||||
|
fi
|
||||||
|
if [ -d "./Windows/" ]; then
|
||||||
|
cd ./Windows/
|
||||||
|
tar -czf ../${{ github.event.repository.name }}-${version}-windows.tar.gz -T <(\ls -1)
|
||||||
|
cd -
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Release
|
||||||
|
uses: svenstaro/upload-release-action@v2
|
||||||
|
with:
|
||||||
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
file: '*.tar.gz'
|
||||||
|
tag: ${{ github.ref }}
|
||||||
|
file_glob: true
|
||||||
2
AMBuildScript
generated
2
AMBuildScript
generated
|
|
@ -188,6 +188,8 @@ class MMSPluginConfig(object):
|
||||||
if builder.options.mms_path:
|
if builder.options.mms_path:
|
||||||
self.mms_root = builder.options.mms_path
|
self.mms_root = builder.options.mms_path
|
||||||
else:
|
else:
|
||||||
|
self.mms_root = ResolveEnvPath('MMSOURCE20', 'mmsource-2.0')
|
||||||
|
if not self.mms_root:
|
||||||
self.mms_root = ResolveEnvPath('MMSOURCE112', 'mmsource-1.12')
|
self.mms_root = ResolveEnvPath('MMSOURCE112', 'mmsource-1.12')
|
||||||
if not self.mms_root:
|
if not self.mms_root:
|
||||||
self.mms_root = ResolveEnvPath('MMSOURCE111', 'mmsource-1.11')
|
self.mms_root = ResolveEnvPath('MMSOURCE111', 'mmsource-1.11')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue