build: workflow from hell (#1)
All checks were successful
Build / build-linux (push) Successful in 7s
All checks were successful
Build / build-linux (push) Successful in 7s
This commit is contained in:
parent
09af9cba74
commit
8091ca53bb
23
.gitea/scripts/ci.sh
Executable file
23
.gitea/scripts/ci.sh
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# setup
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
mkdir iw4
|
||||||
|
mkdir iw5
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# ready for release
|
||||||
|
cp iw4/scripts/mp/_jump.gsc build/iw4
|
||||||
|
|
||||||
|
# replace gsc extension with c. It will make gcc very happy
|
||||||
|
mv iw5/scripts/mp/_jump.gsc iw5/scripts/mp/_jump.c
|
||||||
|
|
||||||
|
# perform macro expansion
|
||||||
|
gcc -D_UTILITY_DEBUG -DIW5 -DCI -E "iw5/scripts/mp/_jump.c" -o _jump.in
|
||||||
|
|
||||||
|
# remove things gcc added to the file that we do not need
|
||||||
|
python3 .gitea/scripts/clean.py _jump.in _jump.gsc
|
||||||
|
|
||||||
|
# ready for release
|
||||||
|
mv _jump.gsc build/iw5/_jump.gsc
|
20
.gitea/scripts/clean.py
Normal file
20
.gitea/scripts/clean.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import sys
|
||||||
|
|
||||||
|
def erase_commented_lines(filename, out):
|
||||||
|
with open(filename, 'r') as file:
|
||||||
|
lines = file.readlines()
|
||||||
|
|
||||||
|
lines = [line for line in lines if not line.startswith('#')]
|
||||||
|
|
||||||
|
with open(out, 'w') as file:
|
||||||
|
file.writelines(lines)
|
||||||
|
|
||||||
|
def main():
|
||||||
|
if len(sys.argv) != 3:
|
||||||
|
print(f'Usage: python3 {sys.argv[0]} <in> <out>')
|
||||||
|
return
|
||||||
|
|
||||||
|
erase_commented_lines(sys.argv[1], sys.argv[2])
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
25
.gitea/workflows/ci.yml
Normal file
25
.gitea/workflows/ci.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
build-linux:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Check out files
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
fetch-depth: 0
|
||||||
|
lfs: false
|
||||||
|
|
||||||
|
- name: Create release
|
||||||
|
run: |
|
||||||
|
.gitea/scripts/ci.sh
|
||||||
|
|
||||||
|
- name: Upload release
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: release
|
||||||
|
path: |
|
||||||
|
build
|
@ -4,7 +4,11 @@
|
|||||||
#define TOOL
|
#define TOOL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(TOOL)
|
||||||
#inline scripts\mp\_utility;
|
#inline scripts\mp\_utility;
|
||||||
|
#else
|
||||||
|
#include "_utility.gsh"
|
||||||
|
#endif
|
||||||
|
|
||||||
GENERIC_INIT;
|
GENERIC_INIT;
|
||||||
|
|
||||||
@ -14,7 +18,9 @@ onPlayerConnect()
|
|||||||
{
|
{
|
||||||
level waittill( "connected", player );
|
level waittill( "connected", player );
|
||||||
|
|
||||||
|
#if defined(TOOL)
|
||||||
waittillframeend;
|
waittillframeend;
|
||||||
|
#endif
|
||||||
|
|
||||||
BOT_CHK( player );
|
BOT_CHK( player );
|
||||||
|
|
||||||
|
@ -40,13 +40,9 @@
|
|||||||
/* Do not use the + to concatenate strings, let the GSC VM do it for you */
|
/* Do not use the + to concatenate strings, let the GSC VM do it for you */
|
||||||
/* Other clients will have print available */
|
/* Other clients will have print available */
|
||||||
#if defined(IW4MP)
|
#if defined(IW4MP)
|
||||||
#define PRINT_FUNC printConsole
|
#define PRINT_FUNC_NAME printConsole
|
||||||
#else
|
#else
|
||||||
#define PRINT_FUNC print
|
#define PRINT_FUNC_NAME print
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(TOOL)
|
|
||||||
PRINT_FUNC( format __VA_OPT__(,) __VA_ARGS__ )
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _UTILITY_DEBUG
|
#ifdef _UTILITY_DEBUG
|
||||||
@ -54,7 +50,7 @@
|
|||||||
assertEx( cond, msg )
|
assertEx( cond, msg )
|
||||||
|
|
||||||
#define DEBUG_PRINT(msg) \
|
#define DEBUG_PRINT(msg) \
|
||||||
PRINT_FUNC(msg)
|
PRINT_FUNC_NAME( msg )
|
||||||
#else
|
#else
|
||||||
/* The following are "empty" defines with gsc-tool */
|
/* The following are "empty" defines with gsc-tool */
|
||||||
#define _VERIFY(cond, msg)
|
#define _VERIFY(cond, msg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user