Added stop command #162
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: Action Build System | |
on: [push] | |
env: | |
CONTAINER: ubuntu:18.04 | |
jobs: | |
linux: | |
name: Linux Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Start Docker Container | |
run: | | |
docker pull $CONTAINER | |
docker run --name build-container -d -v ${{github.workspace}}:/desktop $CONTAINER tail -f /dev/null | |
- name: Install Development Tools Packages | |
env: | |
SCRIPT: | | |
# Add i386 architecture | |
dpkg --add-architecture i386 | |
# Update repository | |
apt-get update > /dev/null | |
# Install build dependencies | |
apt-get install -qq -y wget unzip build-essential gcc-4.8-multilib g++-4.8-multilib libgcc1:i386 libcurl4-openssl-dev:i386 zlib1g-dev:i386 libssl-dev:i386 > /dev/null | |
# Update alternatives | |
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 100 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8 | |
run: docker exec build-container bash -c "$SCRIPT" | |
- name: Execute Build | |
env: | |
SCRIPT: | | |
# Open makefile directory | |
cd /desktop/MatchBot | |
# Make Release Directory | |
mkdir -p Release | |
# Make linux (Without post build script) | |
make | |
# Make dlls path | |
mkdir -p ../cstrike/addons/matchbot/dlls | |
# Copy release file | |
cp ./Release/matchbot_mm.so ../cstrike/addons/matchbot/dlls | |
# Get latest release version of metamod-r | |
wget --quiet https://github.com/rehlds/Metamod-R/releases/download/1.3.0.149/metamod-bin-1.3.0.149.zip | |
# Unzip metamod library to metamod folder | |
unzip -p metamod-bin*.zip addons/metamod/metamod_i386.so > ../cstrike/addons/metamod/metamod_i386.so | |
# Get latest release version of hitbox_fixer | |
wget --quiet https://github.com/Garey27/hitbox_fixer/releases/download/2.0.3/hitbox_fix-bin-2.0.3.zip | |
# Unzip hitbox_fixer library to metamod folder | |
unzip -p hitbox_fix-bin*.zip addons/hitboxfixer/hitbox_fix_mm_i386.so > ../cstrike/addons/hitboxfixer/hitbox_fix_mm_i386.so | |
# Download Accuracy Fix | |
wget --quiet https://github.com/SmileYzn/AccuracyFix/releases/download/1.1.17/linux32.zip | |
# Unzip accuracy-fix library to metamod folder | |
unzip -p linux32.zip addons/accuracyfix/dlls/accuracyfix_mm.so > ../cstrike/addons/accuracyfix/accuracyfix_mm.so | |
run: docker exec build-container bash -c "$SCRIPT" | |
- name: Deploy artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux32 | |
path: ${{github.workspace}}/cstrike | |
windows: | |
name: Windows Build | |
runs-on: windows-latest | |
env: | |
SOLUTION_FILE_PATH: . | |
BUILD_CONFIGURATION: Release | |
BUILD_PROJECT: MatchBot | |
steps: | |
- name: Setup Checkout | |
uses: actions/checkout@v4 | |
- name: Add MSBuild to PATH | |
uses: microsoft/setup-msbuild@v2 | |
- name: Run Build | |
working-directory: ${{github.workspace}} | |
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} | |
- name: Move release file to publish | |
working-directory: ${{github.workspace}} | |
run: | | |
# Make publish directory | |
mkdir publish\addons\matchbot\dlls | |
# Move cstrike files to publish | |
copy ${{env.SOLUTION_FILE_PATH}}\cstrike\* publish -Recurse -Force | |
# Move released dll to publish | |
copy ${{env.BUILD_CONFIGURATION}}\*.dll publish\addons\matchbot\dlls -Recurse -Force | |
- name: Download Metamod-r | |
run: | | |
# Set assets data | |
$assets = "https://github.com/rehlds/Metamod-R/releases/download/1.3.0.149/metamod-bin-1.3.0.149.zip" | |
# Get ZIP file name | |
$zipName = "metamod-bin-1.3.0.149.zip" | |
# Download ZIP file | |
Invoke-WebRequest -Uri $assets -Out $zipName | |
# Extract ZIP File | |
Expand-Archive $zipName | |
# Get base name from ZIP file | |
$baseName = (Get-Item $zipName).BaseName | |
# DLL from path | |
$fromPath = ".\" + $baseName + "\addons\metamod\metamod.dll" | |
# DLL dest path | |
$DestPath = ".\publish\addons\metamod\metamod.dll" | |
# Copy item | |
Copy-Item -Path $fromPath -Destination $DestPath | |
- name: Download Hitbox Fixer | |
run: | | |
# Set assets data | |
$assets = "https://github.com/Garey27/hitbox_fixer/releases/download/2.0.3/hitbox_fix-bin-2.0.3.zip" | |
# Get ZIP file name | |
$zipName = "hitbox_fix-bin-2.0.3.zip" | |
# Download ZIP file | |
Invoke-WebRequest -Uri $assets -Out $zipName | |
# Extract ZIP File | |
Expand-Archive $zipName | |
# Get base name from ZIP file | |
$baseName = (Get-Item $zipName).BaseName | |
# DLL from path | |
$fromPath = ".\" + $baseName + "\addons\hitboxfixer\hitbox_fix_mm.dll" | |
# DLL dest path | |
$DestPath = ".\publish\addons\hitboxfixer\hitbox_fix_mm.dll" | |
# Copy item | |
Copy-Item -Path $fromPath -Destination $DestPath | |
- name: Download Accuracy Fix | |
run: | | |
# Set assets data | |
$assets = "https://github.com/SmileYzn/AccuracyFix/releases/download/1.1.17/win32.zip" | |
# Get ZIP file name | |
$zipName = "win32.zip" | |
# Download ZIP file | |
Invoke-WebRequest -Uri $assets -Out $zipName | |
# Extract ZIP File | |
Expand-Archive $zipName | |
# Get base name from ZIP file | |
$baseName = (Get-Item $zipName).BaseName | |
# DLL from path | |
$fromPath = ".\" + $baseName + "\addons\accuracyfix\dlls\accuracyfix_mm.dll" | |
# DLL dest path | |
$DestPath = ".\publish\addons\accuracyfix\accuracyfix_mm.dll" | |
# Copy item | |
Copy-Item -Path $fromPath -Destination $DestPath | |
- name: Deploy artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: win32 | |
path: publish/* |