-
Notifications
You must be signed in to change notification settings - Fork 1
250 lines (208 loc) · 9.07 KB
/
add_ons_pack.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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
name: Add-Ons Pack
on: [push]
env:
BUILD_CONFIGURATION: Release
FOLDER_NAME: workspace
GAME_TITLE: Cold Ice Remastered
GAME_FOLDER: ice_beta5
jobs:
compile_tools:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.COLDICE_ADD_ONS_PAT }}
submodules: recursive
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Write Config File
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
"`$Config = @{ 'projectName' = '${{env.GAME_TITLE}}' }" | Add-Content .\${{env.FOLDER_NAME}}\Config.ps1
- name: Compile tools
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
.\${{env.FOLDER_NAME}}\Build-Tools.ps1 -ConfigFile Config
[void](New-Item -Force -ItemType Directory $env:TEMP\bin)
Copy-Item -Recurse -Force .\bin $env:TEMP
Compress-Archive -LiteralPath $env:TEMP\bin -DestinationPath .\tools.zip -Force
- name: Upload tools
uses: actions/upload-artifact@v4
with:
name: compiled_tools
path: ./${{env.FOLDER_NAME}}/tools.zip
compile_wads:
runs-on: windows-latest
needs: [compile_tools]
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.COLDICE_ADD_ONS_PAT }}
submodules: recursive
- name: Download tools
uses: actions/download-artifact@v4
with:
name: compiled_tools
path: ./${{env.FOLDER_NAME}}
- name: Unpack tools
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
Expand-Archive -Path .\${{env.FOLDER_NAME}}\tools.zip -DestinationPath $env:TEMP
Remove-Item .\${{env.FOLDER_NAME}}\bin\\* -Recurse -Force -ErrorAction Ignore
Remove-Item .\${{env.FOLDER_NAME}}\bin -Force -ErrorAction Ignore
Move-Item $env:TEMP\bin .\${{env.FOLDER_NAME}}
Remove-Item .\${{env.FOLDER_NAME}}\tools.zip -Recurse -Force -ErrorAction Ignore
- name: Write Config File
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
"`$Config = @{ 'projectName' = '${{env.GAME_TITLE}}' }" | Add-Content .\${{env.FOLDER_NAME}}\Config.ps1
"`$Config = @{ 'projectName' = '${{env.GAME_TITLE}}'`r`n'addons' = @('quadfrost','defroster') }" | Add-Content .\${{env.FOLDER_NAME}}\add-ons\Config.ps1
- name: Unpack Add-ons
working-directory: ${{env.GITHUB_WORKSPACE}}
run: .\${{env.FOLDER_NAME}}\add-ons\Copy-Addons.ps1 -ConfigFile Config
- name: Compile Wads
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
.\${{env.FOLDER_NAME}}\Build-Wads.ps1 -Clean -ConfigFile Config
Get-ChildItem -Path .\redist\ -Filter *.wad | Copy-Item -Destination $env:TEMP -Force -PassThru
Get-ChildItem -Path $env:TEMP -Filter *.wad | Compress-Archive -DestinationPath .\wads.zip -Force
- name: Upload Wads
uses: actions/upload-artifact@v4
with:
name: compiled_wads
path: ./${{env.FOLDER_NAME}}/wads.zip
compile_addon_maps:
runs-on: windows-latest
needs: [compile_tools, compile_wads]
strategy:
matrix:
map: [quadfrost, defroster]
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.COLDICE_ADD_ONS_PAT }}
submodules: recursive
- name: Download tools
uses: actions/download-artifact@v4
with:
name: compiled_tools
path: ./${{env.FOLDER_NAME}}
- name: Unpack tools
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
Expand-Archive -Path .\${{env.FOLDER_NAME}}\tools.zip -DestinationPath $env:TEMP
Remove-Item .\${{env.FOLDER_NAME}}\bin\\* -Recurse -Force -ErrorAction Ignore
Remove-Item .\${{env.FOLDER_NAME}}\bin -Force -ErrorAction Ignore
Move-Item $env:TEMP\bin .\${{env.FOLDER_NAME}}
Remove-Item .\${{env.FOLDER_NAME}}\tools.zip -Recurse -Force -ErrorAction Ignore
- name: Download wads
uses: actions/download-artifact@v4
with:
name: compiled_wads
path: ./${{env.FOLDER_NAME}}
- name: Unpack wads
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
Expand-Archive -Path .\${{env.FOLDER_NAME}}\wads.zip -DestinationPath $env:TEMP
Get-ChildItem -Path $env:TEMP -Filter *.wad | Move-Item -Destination .\${{env.FOLDER_NAME}}\wads -Force -PassThru
Get-ChildItem -Path $env:TEMP -Filter *.wad | Move-Item -Destination .\${{env.FOLDER_NAME}}\redist -Force -PassThru
Remove-Item .\${{env.FOLDER_NAME}}\wads.zip -Recurse -Force -ErrorAction Ignore
- name: Write Config File
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
"`$Config = @{ 'projectName' = '${{env.GAME_TITLE}}' }" | Add-Content .\${{env.FOLDER_NAME}}\Config.ps1
"`$Config = @{ 'projectName' = '${{env.GAME_TITLE}}'`r`n'addons' = @('quadfrost','defroster') }" | Add-Content .\${{env.FOLDER_NAME}}\add-ons\Config.ps1
- name: Unpack Add-ons
working-directory: ${{env.GITHUB_WORKSPACE}}
run: .\${{env.FOLDER_NAME}}\add-ons\Copy-Addons.ps1 -ConfigFile Config
- name: Compile ${{matrix.map}}
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
.\${{env.FOLDER_NAME}}\Build-Maps.ps1 -Clean -ConfigFile Config -Fast -Map ${{matrix.map}} -NoWad
[void](New-Item -Force -ItemType Directory $env:TEMP\maps)
Copy-Item -Recurse -Force .\redist\maps $env:TEMP
Compress-Archive -LiteralPath $env:TEMP\maps -DestinationPath .\${{matrix.map}}.zip -Force
- name: Upload ${{matrix.map}}
uses: actions/upload-artifact@v4
with:
name: ${{matrix.map}}
path: ./${{env.FOLDER_NAME}}/${{matrix.map}}.zip
combine_maps:
runs-on: windows-latest
needs: [compile_addon_maps]
steps:
- uses: actions/download-artifact@v4
with:
path: ./${{env.FOLDER_NAME}}
- name: Combine Maps
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
[void](New-Item -Force -ItemType Directory $env:TEMP\maps)
Expand-Archive -Path .\${{env.FOLDER_NAME}}\quadfrost\quadfrost.zip -DestinationPath $env:TEMP
Expand-Archive -Path .\${{env.FOLDER_NAME}}\defroster\defroster.zip -DestinationPath $env:TEMP
Compress-Archive -LiteralPath $env:TEMP\maps -DestinationPath .\${{env.FOLDER_NAME}}\maps.zip -Force
- name: Upload Maps
uses: actions/upload-artifact@v4
with:
name: compiled_maps
path: ./${{env.FOLDER_NAME}}/maps.zip
package_addons:
runs-on: windows-latest
needs: [combine_maps]
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.COLDICE_ADD_ONS_PAT }}
submodules: recursive
- name: Download wads
uses: actions/download-artifact@v4
with:
name: compiled_wads
path: ./${{env.FOLDER_NAME}}
- name: Unpack wads
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
Expand-Archive -Path .\${{env.FOLDER_NAME}}\wads.zip -DestinationPath $env:TEMP
Get-ChildItem -Path $env:TEMP -Filter *.wad | Move-Item -Destination .\${{env.FOLDER_NAME}}\redist -Force -PassThru
Remove-Item .\${{env.FOLDER_NAME}}\wads.zip -Recurse -Force -ErrorAction Ignore
- name: Download maps
uses: actions/download-artifact@v4
with:
name: compiled_maps
path: ./${{env.FOLDER_NAME}}
- name: Unpack maps
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
Expand-Archive -Path .\${{env.FOLDER_NAME}}\maps.zip -DestinationPath $env:TEMP
Move-Item $env:TEMP\maps .\${{env.FOLDER_NAME}}\redist
Remove-Item .\${{env.FOLDER_NAME}}\maps.zip -Recurse -Force -ErrorAction Ignore
- name: Download tools
uses: actions/download-artifact@v4
with:
name: compiled_tools
path: ./${{env.FOLDER_NAME}}
- name: Unpack tools
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
Expand-Archive -Path .\${{env.FOLDER_NAME}}\tools.zip -DestinationPath $env:TEMP
Remove-Item .\${{env.FOLDER_NAME}}\bin\\* -Recurse -Force -ErrorAction Ignore
Remove-Item .\${{env.FOLDER_NAME}}\bin -Force -ErrorAction Ignore
Move-Item $env:TEMP\bin .\${{env.FOLDER_NAME}}
Remove-Item .\${{env.FOLDER_NAME}}\tools.zip -Recurse -Force -ErrorAction Ignore
- name: Write Config File
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
"`$Config = @{ 'projectName' = '${{env.GAME_TITLE}}'`r`n'addons' = @('quadfrost','defroster') }" | Add-Content .\${{env.FOLDER_NAME}}\add-ons\Config.ps1
# Assets found redist/ like map artifacts in overviews/
- name: Unpack Add-ons
working-directory: ${{env.GITHUB_WORKSPACE}}
run: .\${{env.FOLDER_NAME}}\add-ons\Copy-Addons.ps1 -ConfigFile Config
- name: Package Cold Ice Add-Ons
working-directory: ${{env.GITHUB_WORKSPACE}}
run: .\${{env.FOLDER_NAME}}\add-ons\Build-Addons-${{env.BUILD_CONFIGURATION}}.ps1 -ConfigFile Config
- name: Archive Cold Ice Add-Ons ${{env.BUILD_CONFIGURATION}}
uses: actions/upload-artifact@v4
with:
name: coldice-addons-build
path: .\${{env.FOLDER_NAME}}\add-ons\*-add-on-*.7z
if-no-files-found: error