-
Notifications
You must be signed in to change notification settings - Fork 326
359 lines (290 loc) · 13.4 KB
/
dotnet.yml
File metadata and controls
359 lines (290 loc) · 13.4 KB
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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on:
workflow_dispatch:
push:
branches:
- '3.8.*'
pull_request:
branches:
- '3.8.*'
schedule:
- cron: "0 3 * * 1" # Weekly (Mon) build to keep artifacts fresh
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.0.x
# Windows builds for all projects
- name: Build Windows Binary for Tutorial/BasicCameraExample
run: dotnet publish Tutorials/BasicCameraExample/BasicCameraExample.csproj -c Release -r win-x64 --self-contained true -o ./artifacts/BasicCameraExample-Windows
- name: Archive Tutorial/BasicCameraExample
uses: actions/upload-artifact@v6
with:
name: Windows-BasicCameraExample
path: artifacts/BasicCameraExample-Windows/**
- name: Build Windows Binary for AutoPong
run: dotnet publish AutoPong/AutoPong.WindowsDX/AutoPong.WindowsDX.csproj -c Release -r win-x64 --self-contained true -o ./artifacts/AutoPong-Windows
- name: Archive AutoPong
uses: actions/upload-artifact@v6
with:
name: Windows-AutoPong
path: artifacts/AutoPong-Windows/**
- name: Build Windows Binary for FuelCell
run: dotnet publish FuelCell/FuelCell.WindowsDX/FuelCell.WindowsDX.csproj -c Release -r win-x64 --self-contained true -o ./artifacts/FuelCell-Windows
- name: Archive FuelCell
uses: actions/upload-artifact@v6
with:
name: Windows-FuelCell
path: artifacts/FuelCell-Windows/**
- name: Build Windows Binary for NeonShooter
run: dotnet publish NeonShooter/NeonShooter.WindowsDX/NeonShooter.WindowsDX.csproj -c Release -r win-x64 --self-contained true -o ./artifacts/NeonShooter-Windows
- name: Archive NeonShooter
uses: actions/upload-artifact@v6
with:
name: Windows-NeonShooter
path: artifacts/NeonShooter-Windows/**
- name: Build Windows Binary for Platformer2D
run: dotnet publish Platformer2D/Windows/Platformer2D.csproj -c Release -r win-x64 --self-contained true -o ./artifacts/Platformer2D-Windows
- name: Archive Platformer2D
uses: actions/upload-artifact@v6
with:
name: Windows-Platformer2D
path: artifacts/Platformer2D-Windows/**
- name: Build ShipGame Content Processor in Release mode
run: dotnet build ShipGame/ShipGame.Dependencies/NormalMappingModelProcessor/NormalMappingModelProcessor.csproj --configuration Release
- name: Build Windows Binary for ShipGame
run: dotnet publish ShipGame/ShipGame.WindowsDX/ShipGame.WindowsDX.csproj -c Release -r win-x64 --self-contained true -o ./artifacts/ShipGame-Windows
- name: Archive ShipGame
uses: actions/upload-artifact@v6
with:
name: Windows-ShipGame
path: artifacts/ShipGame-Windows/**
- name: Build Windows Binary for DungeonSlime
run: dotnet publish Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Platforms/Windows/DungeonSlime.WindowsDX.csproj -c Release -r win-x64 --self-contained true -o ./artifacts/DungeonSlime-Windows
- name: Archive DungeonSlime
uses: actions/upload-artifact@v6
with:
name: Windows-DungeonSlime
path: artifacts/DungeonSlime-Windows/**
build-desktop:
runs-on: macos-latest
env:
MGFXC_WINE_PATH: /Users/runner/.winemonogame
DYLD_LIBRARY_PATH: /usr/lib:/usr/local/lib:/opt/homebrew/lib:/usr/local/bin
steps:
- uses: actions/checkout@v5
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.0.x
- name: Setup for MonoGame
uses: infinitespace-studios/monogame-actions/install-wine@v1.0
- name: Install MonoPack
run: dotnet tool install --global MonoPack
# Desktop builds for all projects
# AutoPong Desktop build is currently disabled due to issues with packaging process
- name: Build and Package AutoPong
run: |
dotnet build AutoPong/AutoPong.DesktopGL/AutoPong.DesktopGL.csproj -c Release
monopack -p AutoPong/AutoPong.DesktopGL/AutoPong.DesktopGL.csproj -o ./artifacts/AutoPong -rids win-x64,linux-x64,osx-x64,osx-arm64 -i AutoPong/AutoPong.DesktopGL/Info.plist -c AutoPong/AutoPong.DesktopGL/AutoPong.DesktopGL.icns -v --macos-universal
- name: Archive AutoPong Windows
uses: actions/upload-artifact@v6
with:
name: Desktop-AutoPong-Windows
path: artifacts/AutoPong/*-win-x64.zip
- name: Archive AutoPong Linux
uses: actions/upload-artifact@v6
with:
name: Desktop-AutoPong-Linux
path: artifacts/AutoPong/*-linux-x64.tar.gz
- name: Archive AutoPong macOS
uses: actions/upload-artifact@v6
with:
name: Desktop-AutoPong-macOS
path: artifacts/AutoPong/*-universal.tar.gz
- name: Build and Package FuelCell
run: |
dotnet build FuelCell/FuelCell.DesktopGL/FuelCell.DesktopGL.csproj -c Release
monopack -p FuelCell/FuelCell.DesktopGL/FuelCell.DesktopGL.csproj -o ./artifacts/FuelCell -rids win-x64,linux-x64,osx-x64,osx-arm64 -i FuelCell/FuelCell.DesktopGL/Info.plist -c FuelCell/FuelCell.DesktopGL/FuelCell.DesktopGL.icns -v --macos-universal
- name: Archive FuelCell Windows
uses: actions/upload-artifact@v6
with:
name: Desktop-FuelCell-Windows
path: artifacts/FuelCell/*-win-x64.zip
- name: Archive FuelCell Linux
uses: actions/upload-artifact@v6
with:
name: Desktop-FuelCell-Linux
path: artifacts/FuelCell/*-linux-x64.tar.gz
- name: Archive FuelCell macOS
uses: actions/upload-artifact@v6
with:
name: Desktop-FuelCell-macOS
path: artifacts/FuelCell/*-universal.tar.gz
- name: Build and Package NeonShooter
run: |
dotnet build NeonShooter/NeonShooter.DesktopGL/NeonShooter.DesktopGL.csproj -c Release
monopack -p NeonShooter/NeonShooter.DesktopGL/NeonShooter.DesktopGL.csproj -o ./artifacts/NeonShooter -rids win-x64,linux-x64,osx-x64,osx-arm64 -i NeonShooter/NeonShooter.DesktopGL/Info.plist -c NeonShooter/NeonShooter.DesktopGL/NeonShooter.DesktopGL.icns -v --macos-universal
- name: Archive NeonShooter Windows
uses: actions/upload-artifact@v6
with:
name: Desktop-NeonShooter-Windows
path: artifacts/NeonShooter/*-win-x64.zip
- name: Archive NeonShooter Linux
uses: actions/upload-artifact@v6
with:
name: Desktop-NeonShooter-Linux
path: artifacts/NeonShooter/*-linux-x64.tar.gz
- name: Archive NeonShooter macOS
uses: actions/upload-artifact@v6
with:
name: Desktop-NeonShooter-macOS
path: artifacts/NeonShooter/*-universal.tar.gz
- name: Build and Package Platformer2D
run: |
dotnet build Platformer2D/Desktop/Platformer2D.csproj -c Release
monopack -p Platformer2D/Desktop/Platformer2D.csproj -o ./artifacts/Platformer2D -rids win-x64,linux-x64,osx-x64,osx-arm64 -i Platformer2D/Desktop/Info.plist -c Platformer2D/Desktop/Platformer2D.icns -v --macos-universal
- name: Archive Platformer2D Windows
uses: actions/upload-artifact@v6
with:
name: Desktop-Platformer2D-Windows
path: artifacts/Platformer2D/*-win-x64.zip
- name: Archive Platformer2D Linux
uses: actions/upload-artifact@v6
with:
name: Desktop-Platformer2D-Linux
path: artifacts/Platformer2D/*-linux-x64.tar.gz
- name: Archive Platformer2D macOS
uses: actions/upload-artifact@v6
with:
name: Desktop-Platformer2D-macOS
path: artifacts/Platformer2D/*-universal.tar.gz
- name: Build and Package DungeonSlime
run: |
dotnet build Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Platforms/Desktop/DungeonSlime.csproj -c Release
monopack -p Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Platforms/Desktop/DungeonSlime.csproj -o ./artifacts/learn-monogame-2d -rids win-x64,linux-x64,osx-x64,osx-arm64 -i Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Platforms/Desktop/Info.plist -c Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Platforms/Desktop/DungeonSlime.icns -v --macos-universal
- name: Archive DungeonSlime Windows
uses: actions/upload-artifact@v6
with:
name: Desktop-DungeonSlime-Windows
path: artifacts/learn-monogame-2d/*-win-x64.zip
- name: Archive DungeonSlime Linux
uses: actions/upload-artifact@v6
with:
name: Desktop-DungeonSlime-Linux
path: artifacts/learn-monogame-2d/*-linux-x64.tar.gz
- name: Archive DungeonSlime macOS
uses: actions/upload-artifact@v6
with:
name: Desktop-DungeonSlime-macOS
path: artifacts/learn-monogame-2d/*-universal.tar.gz
- name: Build ShipGame Content Processor
run: dotnet build ShipGame/ShipGame.Dependencies/NormalMappingModelProcessor/NormalMappingModelProcessor.csproj --configuration Release
- name: Build and Package ShipGame
run: |
dotnet build ShipGame/ShipGame.DesktopGL/ShipGame.DesktopGL.csproj -c Release
monopack -p ShipGame/ShipGame.DesktopGL/ShipGame.DesktopGL.csproj -o ./artifacts/ShipGame -rids win-x64,linux-x64,osx-x64,osx-arm64 -i ShipGame/ShipGame.DesktopGL/Info.plist -c ShipGame/ShipGame.DesktopGL/ShipGame.DesktopGL.icns -v --macos-universal
- name: Archive ShipGame Windows
uses: actions/upload-artifact@v6
with:
name: Desktop-ShipGame-Windows
path: artifacts/ShipGame/*-win-x64.zip
- name: Archive ShipGame Linux
uses: actions/upload-artifact@v6
with:
name: Desktop-ShipGame-Linux
path: artifacts/ShipGame/*-linux-x64.tar.gz
- name: Archive ShipGame macOS
uses: actions/upload-artifact@v6
with:
name: Desktop-ShipGame-macOS
path: artifacts/ShipGame/*-universal.tar.gz
build-android:
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.0.x
- name: Setup Java JDK
uses: actions/setup-java@v4
with:
distribution: 'microsoft'
java-version: '17'
- name: Install .NET Android workload
run: dotnet workload install android
# Android builds for all projects
- name: Build Android Binary for AutoPong
run: dotnet build AutoPong/AutoPong.Android/AutoPong.Android.csproj -c Release
- name: Archive AutoPong Android
uses: actions/upload-artifact@v6
with:
name: Android-AutoPong
path: AutoPong/AutoPong.Android/bin/Release/net9.0-android/**/*-Signed.apk
- name: Build Android Binary for FuelCell
run: dotnet build FuelCell/FuelCell.Android/FuelCell.Android.csproj -c Release
- name: Archive FuelCell Android
uses: actions/upload-artifact@v6
with:
name: Android-FuelCell
path: FuelCell/FuelCell.Android/bin/Release/net9.0-android/**/*-Signed.apk
- name: Build Android Binary for NeonShooter
run: dotnet build NeonShooter/NeonShooter.Android/NeonShooter.Android.csproj -c Release
- name: Archive NeonShooter Android
uses: actions/upload-artifact@v6
with:
name: Android-NeonShooter
path: NeonShooter/NeonShooter.Android/bin/Release/net9.0-android/**/*-Signed.apk
- name: Build Android Binary for Platformer2D
run: dotnet build Platformer2D/Android/Platformer2D.csproj -c Release
- name: Archive Platformer2D Android
uses: actions/upload-artifact@v6
with:
name: Android-Platformer2D
path: Platformer2D/Android/bin/Release/net9.0-android/**/*-Signed.apk
- name: Build Android Binary for DungeonSlime
run: dotnet build Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Platforms/Android/DungeonSlime.csproj -c Release
- name: Archive DungeonSlime Android
uses: actions/upload-artifact@v6
with:
name: Android-DungeonSlime
path: Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Platforms/Android/bin/Release/net9.0-android/**/*-Signed.apk
- name: Build ShipGame Content Processor in Release mode
run: dotnet build ShipGame/ShipGame.Dependencies/NormalMappingModelProcessor/NormalMappingModelProcessor.csproj --configuration Release
- name: Build Android Binary for ShipGame
run: dotnet build ShipGame/ShipGame.Android/ShipGame.Android.csproj -c Release
- name: Archive ShipGame Android
uses: actions/upload-artifact@v6
with:
name: Android-ShipGame
path: ShipGame/ShipGame.Android/bin/Release/net9.0-android/**/*-Signed.apk
deploy:
name: Deploy
needs: [ build-windows, build-desktop, build-android ]
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
permissions:
packages: write
contents: write
steps:
- name: Clone Repository
uses: actions/checkout@v4
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
- name: Make a Release
if: github.ref_type == 'tag'
uses: ncipollo/release-action@v1
with:
name: 'MonoGame ${{ github.ref_name }}'
tag: ${{ github.ref_name }}
allowUpdates: true
removeArtifacts: true
artifacts: "*.zip"
token: ${{ secrets.GITHUB_TOKEN }}