build: workflow from hell #1

Merged
Future merged 15 commits from build/ci into main 2024-03-20 17:11:36 +00:00
3 changed files with 25 additions and 2 deletions
Showing only changes of commit d935b12b35 - Show all commits

View File

@ -15,4 +15,7 @@ mv iw5/scripts/mp/_jump.gsc iw5/scripts/mp/_jump.c
# perform macro expansion # perform macro expansion
gcc -D_UTILITY_DEBUG -DIW5 -DCI -E "iw5/scripts/mp/_jump.c" -o _jump.in gcc -D_UTILITY_DEBUG -DIW5 -DCI -E "iw5/scripts/mp/_jump.c" -o _jump.in
mv _jump.in build/iw5/_jump.gsc # remove things gcc added to the file
python3 .gitea/scripts/clean.py _jump.in _jump.gsc
mv _jump.gsc build/iw5/_jump.gsc

20
.gitea/scripts/clean.py Normal file
View 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()

View File

@ -18,7 +18,7 @@ jobs:
.gitea/scripts/ci.sh .gitea/scripts/ci.sh
- name: Upload release - name: Upload release
uses: actions/upload-artifact@v3.1.2 uses: actions/upload-artifact@v3
with: with:
name: release name: release
path: | path: |