-
Notifications
You must be signed in to change notification settings - Fork 35
164 lines (156 loc) · 4.4 KB
/
build_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: Build and Release
on:
release:
types: [created]
push:
branches:
- main
pull_request:
paths:
- 'lq1/**'
- 'qsrc/**'
- 'texture-wads/**'
env:
PYTHONUNBUFFERED: 1
# Cancel redundant builds on the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_wads:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: bash -x .github/scripts/install_deps.sh
- name: Build wads
run: python build.py --compile-wads
- name: Upload texture-wads-artifact
uses: actions/upload-artifact@v4
with:
name: texture-wads-artifact
path: texture-wads/*.wad
build_progs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: bash -x .github/scripts/install_deps.sh
- name: Build progs
run: python build.py --compile-progs
- name: Upload progs-artifact
uses: actions/upload-artifact@v4
with:
name: progs-artifact
path: lq1/progs.dat
build_maps:
needs: build_wads
runs-on: ubuntu-latest
strategy:
matrix:
map_dir: [brushmodels, dm, e0, e1, e2, e3, e4, misc]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: bash -x .github/scripts/install_deps.sh
- name: Download texture-wads-artifact
uses: actions/download-artifact@v4
with:
name: texture-wads-artifact
path: texture-wads
- name: Build maps
run: |
cd lq1/maps
python compile_maps.py -d src/${{ matrix.map_dir }}
- name: Upload maps-artifact
uses: actions/upload-artifact@v4
with:
name: maps-artifact-${{ matrix.map_dir }}
if-no-files-found: error
path: |
lq1/maps/*.bsp
lq1/maps/*.lit
assemble_releases:
needs: [build_wads, build_progs, build_maps]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Download all the artifacts created so far
- name: Download texture-wads-artifact
uses: actions/download-artifact@v4
with:
name: texture-wads-artifact
path: texture-wads
- name: Download progs-artifact
uses: actions/download-artifact@v4
with:
name: progs-artifact
path: lq1/
- name: Download maps-artifacts
uses: actions/download-artifact@v4
with:
pattern: maps-artifact-*
path: lq1/maps/
merge-multiple: true
# Assemble the releases from the artifacts
- name: Install dependencies
run: bash -x .github/scripts/install_deps.sh
- name: Build releases
run: python build.py --build
- name: Zip artifacts
run: |
cd releases
zip -r full.zip full
zip -r mod.zip mod
zip -r lite.zip lite
zip -r mod_lite.zip mod_lite
zip -r dev.zip dev
cd ..
# Upload the completed release artifacts
- name: Upload full.zip
uses: actions/upload-artifact@v4
with:
name: full.zip
path: releases/full.zip
- name: Upload mod.zip
uses: actions/upload-artifact@v4
with:
name: mod.zip
path: releases/mod.zip
- name: Upload lite.zip
uses: actions/upload-artifact@v4
with:
name: lite.zip
path: releases/lite.zip
- name: Upload mod_lite.zip
uses: actions/upload-artifact@v4
with:
name: mod_lite.zip
path: releases/mod_lite.zip
- name: Upload dev.zip
uses: actions/upload-artifact@v4
with:
name: dev.zip
path: releases/dev.zip
upload_to_release_page:
if: github.event_name == 'release'
needs: assemble_releases
runs-on: ubuntu-latest
strategy:
matrix:
release_type: [full, mod, lite, mod_lite, dev]
steps:
- name: Download release artifacts
uses: actions/download-artifact@v4
with:
name: ${{ matrix.release_type }}.zip
path: releases/
- name: Upload asset ${{ matrix.release_type }}.zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: releases/${{ matrix.release_type }}.zip
asset_name: ${{ matrix.release_type }}.zip
asset_content_type: application/zip