-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
164 changed files
with
5,739 additions
and
843 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: FGD Build and Folder Copy | ||
on: | ||
push: | ||
branches: [ master, dev ] | ||
pull_request: | ||
branches: [ master, dev ] | ||
jobs: | ||
build-windows: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
- name: Install srctools | ||
run: .\install_srctools.bat | ||
- name: FGD build and folder copy | ||
run: .\build.bat all | ||
- name: Artifact upload | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: build_${{ runner.os }}-${{ github.sha }} | ||
path: ./build/*.fgd | ||
if-no-files-found: error | ||
build-linux: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
- name: Install srctools | ||
run: bash ./install_srctools.sh | ||
- name: FGD build and folder copy | ||
run: bash ./build.sh all | ||
- name: Artifact upload | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: build_${{ runner.os }}-${{ github.sha }} | ||
path: ./build/*.fgd | ||
if-no-files-found: error |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,50 @@ | ||
robocopy hammer build/hammer /S /PURGE | ||
robocopy instances build/instances /XF *.vmx /S /PURGE | ||
robocopy transforms build/postcompiler/transforms /PURGE | ||
python unify_fgd.py exp p2 srctools -o "build/portal2.fgd" | ||
python unify_fgd.py exp p1 srctools -o "build/portal.fgd" | ||
python unify_fgd.py exp hl2 srctools -o "build/hl2.fgd" | ||
python unify_fgd.py exp ep1 ep2 srctools -o "build/episodic.fgd" | ||
python unify_fgd.py exp gmod srctools -o "build/gmod.fgd" | ||
python unify_fgd.py exp csgo srctools -o "build/csgo.fgd" | ||
python unify_fgd.py exp tf2 srctools -o "build/tf2.fgd" | ||
python unify_fgd.py exp asw srctools -o "build/asw.fgd" | ||
python unify_fgd.py exp l4d srctools -o "build/l4d.fgd" | ||
python unify_fgd.py exp l4d2 srctools -o "build/left4dead2.fgd" | ||
python unify_fgd.py exp infra srctools -o "build/infra.fgd" | ||
python unify_fgd.py exp mesa srctools -o "build/blackmesa.fgd" | ||
@echo off | ||
setlocal EnableDelayedExpansion | ||
|
||
SET games=p2 p1 hl2 ep1 ep2 gmod csgo tf2 asw l4d l4d2 infra mesa | ||
|
||
:: If set, override the FGD filename generated. | ||
SET filename.p2=portal2 | ||
SET filename.p1=portal | ||
SET filename.ep1=episodic | ||
SET filename.tf2=tf | ||
SET filename.l4d=left4dead | ||
SET filename.l4d2=left4dead2 | ||
SET filename.mesa=blackmesa | ||
SET game=%1 | ||
|
||
:: Make sure game isn't empty | ||
:while | ||
IF [%game%]==[] (echo Games: %games% & echo Enter game to build. Use ALL to build every game. & SET /P game= & GOTO :while) | ||
|
||
IF /I %game%==ALL ( | ||
CALL :copy_hammer_files | ||
(FOR %%i in (%games%) do ( | ||
CALL :build_game %%i | ||
)) | ||
EXIT | ||
) ELSE ( | ||
(FOR %%i in (%games%) do ( | ||
IF /I %game%==%%i ( | ||
CALL :copy_hammer_files | ||
CALL :build_game %game% | ||
EXIT | ||
) | ||
)) | ||
echo Unknown game. Exitting. & EXIT /B 1 | ||
) | ||
|
||
:build_game | ||
SET tag=%1 | ||
IF DEFINED filename.%tag% (SET fname=!filename.%tag%!) ELSE (SET fname=%tag%) | ||
echo Building FGD for %1 as "%fname%.fgd"... | ||
py unify_fgd.py exp "%tag%" srctools -o "build/%fname%.fgd" | ||
IF %ERRORLEVEL% NEQ 0 (echo Building FGD for %tag% has failed. Exitting. & EXIT) | ||
EXIT /B | ||
|
||
:copy_hammer_files | ||
echo Copying Hammer files... | ||
IF %ERRORLEVEL% LSS 8 robocopy hammer build/hammer /S /PURGE | ||
IF %ERRORLEVEL% LSS 8 robocopy instances build/instances /XF *.vmx /S /PURGE | ||
IF %ERRORLEVEL% LSS 8 EXIT /B 0 | ||
echo Failed copying Hammer files. Exitting. & EXIT |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/sh | ||
games="p2 p1 hl2 ep1 ep2 gmod csgo tf2 asw l4d l4d2 infra mesa" | ||
game=$1 | ||
if [ $# -eq 0 ]; then | ||
echo Games: "${games[*]}" & echo Enter game to build. Use ALL to build every game. & read -p "" game | ||
fi | ||
|
||
copy_hammer_files() { | ||
echo "Copying Hammer files..." | ||
mkdir -p build/postcompiler && | ||
cp -rf hammer build/hammer && | ||
cp -rf instances build/instances && | ||
cp -rf transforms build/postcompiler/transforms && | ||
find ./build/instances -iname "*.vmx" -delete # Yes, I know that we could use rsync with a ton of options to do this instead of using cp and then deleting unwanted files. This is FAR nicer imo. | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Failed copying Hammer files. Exitting." & exit 1 | ||
fi | ||
return 0 | ||
} | ||
|
||
build_game() { | ||
echo "Building FGD for $1..." | ||
python3 unify_fgd.py exp $1 srctools -o "build/$1.fgd" | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Building FGD for $1 has failed. Exitting." & exit 1 | ||
fi | ||
return 0 | ||
} | ||
|
||
if [ "${game^^}" = "ALL" ]; then | ||
copy_hammer_files | ||
for i in $games | ||
do | ||
build_game $i | ||
done | ||
else | ||
for i in $games | ||
do | ||
if [ "$i" = "$game" ]; then | ||
copy_hammer_files | ||
build_game $game | ||
exit | ||
fi | ||
echo "Unknown game. Exitting." & exit 1 | ||
done | ||
fi |
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
Oops, something went wrong.