1- name : FGD Build and Folder Copy
1+ name : Build FGD
22on :
3- pull_request :
3+ push :
44 branches :
55 - master
6+
7+ workflow_dispatch :
68
79jobs :
8- build-windows :
9- runs-on : windows-latest
10+ create-release :
11+
12+ runs-on : ubuntu-latest
13+ name : Create Release
1014 steps :
1115 - name : Checkout
12- uses : actions/checkout@v3
16+ uses : actions/checkout@v4
17+
18+ - run : git fetch --tags origin
19+
20+ - name : Get previous tag
21+ id : previoustag
22+ uses : ' WyriHaximus/github-action-get-previous-tag@v1'
23+ env :
24+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
1325
14- - name : Setup Python
15- uses : actions/setup-python@v4
26+ - name : Next Monotonic Release version
27+ id : next
28+ uses : WyriHaximus/github-action-next-release-version@08a7476c98e8095fad1cce0e2344c7892e17d111
1629 with :
17- python- version : ' 3.10 '
30+ version : ${{ steps.previoustag.outputs.tag }}
1831
19- - name : Install srctools
20- run : python -m pip install git+https://github.com/StrataSource/srctools.git
21-
22- - name : FGD build and folder copy
23- run : .\build.bat fgd all
24-
25- - name : Artifact upload
26- uses : actions/upload-artifact@v4
32+ - name : Create Release
33+ uses : softprops/action-gh-release@v1
34+ if : ${{ github.event.inputs.version == '' }}
2735 with :
28- name : build_${{ runner.os }}-${{ github.sha }}
29- path : ./build/*
30- if-no-files-found : error
31-
32- build-linux :
36+ tag_name : ${{ steps.next.outputs.version }}
37+
38+
39+ build :
3340 runs-on : ubuntu-latest
41+
42+ needs : create-release
43+ if : ${{ always() && !cancelled() && needs.create-release.result == 'success' }}
3444 steps :
3545 - name : Checkout
36- uses : actions/checkout@v3
37-
46+ uses : actions/checkout@v4
47+
3848 - name : Setup Python
39- uses : actions/setup-python@v4
49+ uses : actions/setup-python@v5
4050 with :
41- python-version : ' 3.10'
51+ python-version : ' 3.13'
52+ cache : ' pip'
53+ cache-dependency-path : ' requirements.txt'
54+
55+ - name : Install dependencies
56+ run : |
57+ python -m pip install -r requirements.txt
4258
43- - name : Install srctools
44- run : python3 -m pip install git+https://github.com/StrataSource/srctools.git
59+ - uses : robinraju/release-downloader@v1
60+ with :
61+ repository : ' Project-Collapse-Studios/HammerAddons'
62+ latest : true
63+ fileName : ' patch.fgd'
64+ tarBall : false
65+ zipBall : false
66+ out-file-path : ' downloads'
67+
68+ - run : python unify_fgd.py -d ./fgd/ --extra ./downloads/patch.fgd exp -o psc.fgd P2CE SRCTOOLS
4569
46- - name : FGD build and folder copy
47- run : bash ./build.sh fgd all
70+ - run : git fetch --tags origin
71+
72+ - name : Get previous tag
73+ id : previoustag
74+ uses : ' WyriHaximus/github-action-get-previous-tag@v1'
75+ env :
76+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
77+
78+ - name : Upload to release
79+ uses : softprops/action-gh-release@v1
80+ if : ${{ github.event.inputs.version == '' }}
81+ with :
82+ tag_name : ${{ steps.previoustag.outputs.tag }}
83+ files : psc.fgd
84+ fail_on_unmatched_files : true
0 commit comments