Skip to content

Commit

Permalink
Update workflow
Browse files Browse the repository at this point in the history
- Updated build workflow
- Update Metamod SDK
- Update CSSDK
  • Loading branch information
SmileYzn committed Aug 13, 2024
1 parent 1833d4d commit aab73ac
Show file tree
Hide file tree
Showing 12 changed files with 967 additions and 986 deletions.
151 changes: 134 additions & 17 deletions .github/workflows/makefile.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Linux Build CI
name: Build C/C++

on:
push:
Expand All @@ -7,8 +7,8 @@ on:
branches: [ main ]

jobs:
build:

linux:
name: Linux Build
runs-on: ubuntu-latest

steps:
Expand All @@ -28,7 +28,7 @@ jobs:
mkdir temp
cd temp
# AMD 64
# amd64
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-4.8/g++-4.8_4.8.5-4ubuntu8_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-4.8/libstdc++-4.8-dev_4.8.5-4ubuntu8_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-4.8/gcc-4.8-base_4.8.5-4ubuntu8_amd64.deb
Expand All @@ -50,18 +50,15 @@ jobs:
- name: Update GCC and G++ alternatives
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
- name: G++ version
run: g++ --version
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
- name: Run build
working-directory: ./MatchBot
run: make

- name: Move release file to publish
run: |
# Make Match BOT path
Expand Down Expand Up @@ -89,16 +86,136 @@ jobs:
# Unzip hitbox_fixer library to metamod folder
unzip -p hitbox_fix-bin*.zip addons/hitbox_fix/hitbox_fix_mm_i386.so > publish/addons/hitbox_fix/hitbox_fix_mm_i386.so
- name: Download accuracy-fix
- name: Download Accuracy Fix
run: |
# Get latest release version of accuracy-fix
wget --quiet https://github.com/SmileYzn/AccuracyFix/releases/download/1.1.2/accuracyfix-linux.zip
# Get latest release version of Accuracy Fix
wget --quiet https://github.com/SmileYzn/AccuracyFix/releases/download/1.1.3/linux32.zip
# Unzip accuracy-fix library to metamod folder
unzip -p accuracyfix-linux.zip addons/accuracyfix/dlls/accuracyfix_mm.so > publish/addons/accuracyfix/accuracyfix_mm.so
unzip -p linux32.zip addons/accuracyfix/dlls/accuracyfix_mm.so > publish/addons/accuracyfix/accuracyfix_mm.so
- name: Deploy artifacts
uses: actions/upload-artifact@v4
with:
name: matchbot-linux
name: linux32
path: publish/*

windows:
name: Windows Build
runs-on: windows-latest

env:
SOLUTION_FILE_PATH: .
BUILD_CONFIGURATION: Release

steps:
- uses: actions/checkout@v4

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}

- name: Run Build
working-directory: ${{env.GITHUB_WORKSPACE}}
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}

- name: Move release file to publish
working-directory: ${{env.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/theAsmodai/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.138.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/1.1.5/hitbox_fix-bin-1.1.5.zip"
# Get ZIP file name
$zipName = "hitbox_fix-bin-1.1.5.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\hitbox_fix\hitbox_fix_mm.dll"
# DLL dest path
$DestPath = ".\publish\addons\hitbox_fix\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.3/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/*


128 changes: 0 additions & 128 deletions .github/workflows/msbuild.yml

This file was deleted.

Loading

0 comments on commit aab73ac

Please sign in to comment.