-
Notifications
You must be signed in to change notification settings - Fork 2
613 lines (573 loc) · 31.7 KB
/
githubactionsbuilds.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
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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
name: GitHubActionsBuilds
on: push
jobs:
generate_version_number:
permissions:
contents: write
runs-on: ubuntu-latest
outputs:
build_number: ${{ github.ref == 'refs/heads/master' && steps.buildnumber.outputs.build_number || 1 }}
steps:
- name: Generate build number
if: github.ref == 'refs/heads/master'
id: buildnumber
uses: onyxmueller/build-tag-number@v1
with:
token: ${{secrets.github_token}}
build_docker:
needs: generate_version_number
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: devedse
password: ${{ secrets.DOCKERHUBTOKEN }}
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: all
- name: Available platforms
run: echo ${{ steps.qemu.outputs.platforms }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Builder instance name
run: echo ${{ steps.buildx.outputs.name }}
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Set Image Tags
id: tags
run: |
VERSION=1.0.${{needs.generate_version_number.outputs.build_number}}
echo Version: $VERSION
echo github.ref: ${{ github.ref }}
echo github.actor: ${{ github.actor }}
echo branch name: ${GITHUB_REF#refs/heads/}
BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')
echo parsed branch name: ${BRANCH_NAME}
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
if [[ "${{ github.ref }}" == 'refs/heads/master' ]]; then
echo "TAGS=-t devedse/devemazegeneratorcoreweb:${VERSION} -t devedse/devemazegeneratorcoreweb:latest" >> $GITHUB_OUTPUT
elif [[ "${{ github.actor }}" == 'dependabot[bot]' ]]; then
echo "TAGS=-t devedse/devemazegeneratorcoreweb:beta_${BRANCH_NAME}" >> $GITHUB_OUTPUT
else
echo "TAGS=-t devedse/devemazegeneratorcoreweb:beta_${BRANCH_NAME} -t devedse/devemazegeneratorcoreweb:beta_nightly" >> $GITHUB_OUTPUT
fi
- name: Run Buildx
run: |
docker buildx build -f DeveMazeGeneratorCore.Web/Dockerfile --build-arg BUILD_VERSION=${{steps.tags.outputs.version}} --platform linux/arm64,linux/amd64 ${{steps.tags.outputs.tags}} ${{ (github.event_name != 'pull_request' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)) && '--push' || '' }} .
build_docker_monogame_blazor:
needs: generate_version_number
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: devedse
password: ${{ secrets.DOCKERHUBTOKEN }}
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: all
- name: Available platforms
run: echo ${{ steps.qemu.outputs.platforms }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Builder instance name
run: echo ${{ steps.buildx.outputs.name }}
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Set Image Tags
id: tags
run: |
VERSION=1.0.${{needs.generate_version_number.outputs.build_number}}
echo Version: $VERSION
echo github.ref: ${{ github.ref }}
echo github.actor: ${{ github.actor }}
echo branch name: ${GITHUB_REF#refs/heads/}
BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')
echo parsed branch name: ${BRANCH_NAME}
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
if [[ "${{ github.ref }}" == 'refs/heads/master' ]]; then
echo "TAGS=-t devedse/devemazegeneratorcoremonogameblazor:${VERSION} -t devedse/devemazegeneratorcoremonogameblazor:latest" >> $GITHUB_OUTPUT
elif [[ "${{ github.actor }}" == 'dependabot[bot]' ]]; then
echo "TAGS=-t devedse/devemazegeneratorcoremonogameblazor:beta_${BRANCH_NAME}" >> $GITHUB_OUTPUT
else
echo "TAGS=-t devedse/devemazegeneratorcoremonogameblazor:beta_${BRANCH_NAME} -t devedse/devemazegeneratorcoremonogameblazor:beta_nightly" >> $GITHUB_OUTPUT
fi
- name: Run Buildx
run: |
docker buildx build -f DeveMazeGeneratorCore.MonoGame.Blazor/Dockerfile --build-arg BUILD_VERSION=${{steps.tags.outputs.version}} --platform linux/arm64,linux/amd64 ${{steps.tags.outputs.tags}} ${{ (github.event_name != 'pull_request' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)) && '--push' || '' }} .
build_linux:
needs: generate_version_number
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install dependencies
run: dotnet restore DeveMazeGeneratorCore.sln
- name: Build
run: dotnet build DeveMazeGeneratorCore.sln -c Release --no-restore /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}}
- name: Test
run: dotnet test DeveMazeGeneratorCore.sln -c Release --no-restore --verbosity normal
build_linux_consoleapp:
needs: generate_version_number
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Publish Untrimmed
run: dotnet publish DeveMazeGeneratorCore.ConsoleApp/DeveMazeGeneratorCore.ConsoleApp.csproj -c Release -r linux-x64 -o DeveMazeGeneratorCore.ConsoleApp/bin/Release/net8.0/linux-x64/publishuntrimmed/ /p:PublishSingleFile=true /p:SelfContained=true /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}}
- name: Publish Trimmed
run: dotnet publish DeveMazeGeneratorCore.ConsoleApp/DeveMazeGeneratorCore.ConsoleApp.csproj -c Release -r linux-x64 -o DeveMazeGeneratorCore.ConsoleApp/bin/Release/net8.0/linux-x64/publishtrimmed/ /p:PublishSingleFile=true /p:SelfContained=true /p:PublishTrimmed=true /p:TrimMode=full /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}}
- name: Publish Trimmed AOT
run: dotnet publish DeveMazeGeneratorCore.ConsoleApp/DeveMazeGeneratorCore.ConsoleApp.csproj -c Release -r linux-x64 -o DeveMazeGeneratorCore.ConsoleApp/bin/Release/net8.0/linux-x64/publishtrimmedaot/ /p:PublishTrimmed=true /p:TrimMode=full /p:PublishAot=true /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}}
- name: Copy output
shell: bash
run: |
mkdir BuildOutputConsole
mv ./DeveMazeGeneratorCore.ConsoleApp/bin/Release/net8.0/linux-x64/publishuntrimmed/DeveMazeGenerator.ConsoleApp ./BuildOutputConsole/DeveMazeGenerator.ConsoleApp.Untrimmed
mv ./DeveMazeGeneratorCore.ConsoleApp/bin/Release/net8.0/linux-x64/publishtrimmed/DeveMazeGenerator.ConsoleApp ./BuildOutputConsole/DeveMazeGenerator.ConsoleApp.Trimmed
mv ./DeveMazeGeneratorCore.ConsoleApp/bin/Release/net8.0/linux-x64/publishtrimmedaot/DeveMazeGenerator.ConsoleApp ./BuildOutputConsole/DeveMazeGenerator.ConsoleApp.TrimmedAot
- uses: actions/upload-artifact@v4
with:
name: DeveMazeGeneratorCore.ConsoleApp.Linux
path: BuildOutputConsole/*
build_windows_consoleapp:
needs: generate_version_number
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Publish Untrimmed
run: dotnet publish DeveMazeGeneratorCore.ConsoleApp/DeveMazeGeneratorCore.ConsoleApp.csproj -c Release -r win-x64 -o DeveMazeGeneratorCore.ConsoleApp/bin/Release/net8.0/win-x64/publishuntrimmed/ /p:PublishSingleFile=true /p:SelfContained=true /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}}
- name: Publish Trimmed
run: dotnet publish DeveMazeGeneratorCore.ConsoleApp/DeveMazeGeneratorCore.ConsoleApp.csproj -c Release -r win-x64 -o DeveMazeGeneratorCore.ConsoleApp/bin/Release/net8.0/win-x64/publishtrimmed/ /p:PublishSingleFile=true /p:SelfContained=true /p:PublishTrimmed=true /p:TrimMode=full /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}}
- name: Publish Trimmed AOT
run: dotnet publish DeveMazeGeneratorCore.ConsoleApp/DeveMazeGeneratorCore.ConsoleApp.csproj -c Release -r win-x64 -o DeveMazeGeneratorCore.ConsoleApp/bin/Release/net8.0/win-x64/publishtrimmedaot/ /p:PublishTrimmed=true /p:TrimMode=full /p:PublishAot=true /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}}
- name: Copy output
shell: bash
run: |
mkdir BuildOutputConsole
mv ./DeveMazeGeneratorCore.ConsoleApp/bin/Release/net8.0/win-x64/publishuntrimmed/DeveMazeGenerator.ConsoleApp.exe ./BuildOutputConsole/DeveMazeGenerator.ConsoleApp.Untrimmed.exe
mv ./DeveMazeGeneratorCore.ConsoleApp/bin/Release/net8.0/win-x64/publishtrimmed/DeveMazeGenerator.ConsoleApp.exe ./BuildOutputConsole/DeveMazeGenerator.ConsoleApp.Trimmed.exe
mv ./DeveMazeGeneratorCore.ConsoleApp/bin/Release/net8.0/win-x64/publishtrimmedaot/DeveMazeGenerator.ConsoleApp.exe ./BuildOutputConsole/DeveMazeGenerator.ConsoleApp.TrimmedAot.exe
- uses: actions/upload-artifact@v4
with:
name: DeveMazeGeneratorCore.ConsoleApp.Windows
path: BuildOutputConsole/*.exe
build_windows:
needs: generate_version_number
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '19' # The JDK version to make available on the path.
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
architecture: x64 # (x64 or x86) - defaults to x64
- name: Install tools
run: |
dotnet tool install --global dotnet-sonarscanner
dotnet tool install --global dotnet-reportgenerator-globaltool
- name: Install dependencies
run: dotnet restore DeveMazeGeneratorCore.sln
- name: SonarQube begin
if: github.actor != 'dependabot[bot]'
run: dotnet-sonarscanner begin /k:"DeveMazeGeneratorCore" /o:"devedse-github" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login=${{secrets.SONARQUBETOKEN}} /d:sonar.cs.opencover.reportsPaths=".\DeveMazeGeneratorCore.Tests\TestResults\Coverage\coverage.opencover.xml" /d:sonar.coverage.exclusions="DeveMazeGeneratorCore.ConsoleApp/**/*.cs,DeveMazeGeneratorCore.Tests/**/*.cs,DeveMazeGeneratorCore.Web/wwwroot/divisionmaze/**/*.js"
- name: Build
run: dotnet build DeveMazeGeneratorCore.sln -c Release --no-restore /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}}
- name: Test
run: dotnet test DeveMazeGeneratorCore.sln --verbosity normal --no-build -c Release --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura,opencover
- name: SonarQube end
if: github.actor != 'dependabot[bot]'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: dotnet-sonarscanner end /d:sonar.login=${{secrets.SONARQUBETOKEN}}
- name: Pack
run: dotnet pack DeveMazeGeneratorCore\DeveMazeGeneratorCore.csproj --verbosity normal --no-build -c Release /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}}
- name: Run CodeCov
uses: codecov/codecov-action@v4
with:
directory: ./DeveMazeGeneratorCore.Tests/TestResults
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Run GoPackage.ps1 script
run: .\Scripts\GoPackage.ps1
shell: pwsh
- uses: actions/upload-artifact@v4
with:
name: DeveMazeGeneratorCore7z
path: ./Scripts/Output/DeveMazeGeneratorCore.7z
- uses: actions/upload-artifact@v4
with:
name: DeveMazeGeneratorCoreZip
path: ./Scripts/Output/DeveMazeGeneratorCore.zip
- uses: actions/upload-artifact@v4
with:
name: DeveMazeGeneratorCoreNuGet
path: |
./DeveMazeGeneratorCore/bin/Release/*.nupkg
./DeveMazeGeneratorCore/bin/Release/*.snupkg
build_linux_monogame_desktopgl:
needs: generate_version_number
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install dependencies
run: dotnet restore DeveMazeGeneratorCore.sln
- name: Build
run: dotnet build DeveMazeGeneratorCore.sln -c Release --no-restore /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}}
- name: Test
run: dotnet test DeveMazeGeneratorCore.sln --no-restore --verbosity normal
- name: Publish
run: dotnet publish ./DeveMazeGeneratorCore.MonoGame.DesktopGL/DeveMazeGeneratorCore.MonoGame.DesktopGL.csproj -r linux-x64 -c Release /p:PublishSingleFile=true /p:SelfContained=true /p:IncludeNativeLibrariesForSelfExtract=true /p:PublishTrimmed=false /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}}
- name: Copy files that are missing for some reason
run: |
# not needed on linux as it seems
ls -R DeveMazeGeneratorCore.MonoGame.DesktopGL/bin/Release/net8.0/linux-x64
ls -R DeveMazeGeneratorCore.MonoGame.DesktopGL/bin/Release/net8.0/linux-x64/publish
shell: bash
- name: targz output
run: |
export GZIP=-9
tar cvzf DeveMazeGeneratorCore.MonoGame.DesktopGL_linux-x64.tar.gz -C DeveMazeGeneratorCore.MonoGame.DesktopGL/bin/Release/net8.0/linux-x64/publish .
- name: 7zip output
run: |
7z a -t7z -m0=LZMA2 -mmt=on -mx9 -md=1536m -mfb=273 -ms=on -mqs=on -sccUTF-8 "DeveMazeGeneratorCore.MonoGame.DesktopGL_linux-x64.7z" "./DeveMazeGeneratorCore.MonoGame.DesktopGL/bin/Release/net8.0/linux-x64/publish/*" '-x!*.pdb'
- uses: actions/upload-artifact@v4
with:
name: DeveMazeGeneratorCore.MonoGame.DesktopGL_linux-x64
path: DeveMazeGeneratorCore.MonoGame.DesktopGL_linux-x64.tar.gz
# AppIcon is missing when building windows application on linux
# So don't use this build
# See: https://github.com/dotnet/runtime/issues/3828
build_windows_monogame_desktopgl_onlinux:
needs: generate_version_number
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install dependencies
run: dotnet restore DeveMazeGeneratorCore.sln
- name: Build
run: dotnet build DeveMazeGeneratorCore.sln -c Release --no-restore /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}}
- name: Test
run: dotnet test DeveMazeGeneratorCore.sln --no-restore --verbosity normal
- name: Publish
run: dotnet publish ./DeveMazeGeneratorCore.MonoGame.DesktopGL/DeveMazeGeneratorCore.MonoGame.DesktopGL.csproj -r win-x64 -c Release /p:PublishSingleFile=true /p:SelfContained=true /p:IncludeNativeLibrariesForSelfExtract=true /p:PublishTrimmed=false /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}}
- name: Copy files that are missing for some reason
run: |
# not needed on linux as it seems
ls -R DeveMazeGeneratorCore.MonoGame.DesktopGL/bin/Release/net8.0/win-x64
cp DeveMazeGeneratorCore.MonoGame.DesktopGL/bin/Release/net8.0/win-x64/SDL2.dll DeveMazeGeneratorCore.MonoGame.DesktopGL/bin/Release/net8.0/win-x64/publish/
cp -R DeveMazeGeneratorCore.MonoGame.DesktopGL/bin/Release/net8.0/win-x64/Content/. DeveMazeGeneratorCore.MonoGame.DesktopGL/bin/Release/net8.0/win-x64/publish/Content/
ls -R DeveMazeGeneratorCore.MonoGame.DesktopGL/bin/Release/net8.0/win-x64/publish
shell: bash
- name: targz output
run: |
export GZIP=-9
tar cvzf DeveMazeGeneratorCore.MonoGame.DesktopGL_win-x64_onlinux.tar.gz -C DeveMazeGeneratorCore.MonoGame.DesktopGL/bin/Release/net8.0/win-x64/publish .
- name: 7zip output
run: |
7z a -t7z -m0=LZMA2 -mmt=on -mx9 -md=1536m -mfb=273 -ms=on -mqs=on -sccUTF-8 "DeveMazeGeneratorCore.MonoGame.DesktopGL_win-x64_onlinux.7z" "./DeveMazeGeneratorCore.MonoGame.DesktopGL/bin/Release/net8.0/win-x64/publish/*" '-x!*.pdb'
- uses: actions/upload-artifact@v4
with:
name: DeveMazeGeneratorCore.MonoGame.DesktopGL_win-x64_onlinuxtargz
path: DeveMazeGeneratorCore.MonoGame.DesktopGL_win-x64_onlinux.tar.gz
- uses: actions/upload-artifact@v4
with:
name: DeveMazeGeneratorCore.MonoGame.DesktopGL_win-x64_onlinux
path: DeveMazeGeneratorCore.MonoGame.DesktopGL_win-x64_onlinux.7z
build_windows_monogame_desktopgl:
needs: generate_version_number
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install dependencies
run: dotnet restore DeveMazeGeneratorCore.sln
- name: Build
run: dotnet build DeveMazeGeneratorCore.sln -c Release --no-restore /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}}
- name: Test
run: dotnet test DeveMazeGeneratorCore.sln --no-restore --verbosity normal
- name: Publish
run: dotnet publish ./DeveMazeGeneratorCore.MonoGame.DesktopGL/DeveMazeGeneratorCore.MonoGame.DesktopGL.csproj -r win-x64 -c Release /p:PublishSingleFile=true /p:SelfContained=true /p:IncludeNativeLibrariesForSelfExtract=true /p:PublishTrimmed=false /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}}
- name: Copy files that are missing for some reason
run: |
ls -R DeveMazeGeneratorCore.MonoGame.DesktopGL/bin/Release/net8.0/win-x64
cp DeveMazeGeneratorCore.MonoGame.DesktopGL/bin/Release/net8.0/win-x64/SDL2.dll DeveMazeGeneratorCore.MonoGame.DesktopGL/bin/Release/net8.0/win-x64/publish/
cp -R DeveMazeGeneratorCore.MonoGame.DesktopGL/bin/Release/net8.0/win-x64/Content/. DeveMazeGeneratorCore.MonoGame.DesktopGL/bin/Release/net8.0/win-x64/publish/Content/
ls -R DeveMazeGeneratorCore.MonoGame.DesktopGL/bin/Release/net8.0/win-x64/Publish
shell: bash
- name: 7zip output
run: |
7z a -t7z -m0=LZMA2 -mmt=on -mx9 -md=1536m -mfb=273 -ms=on -mqs=on -sccUTF-8 "DeveMazeGeneratorCore.MonoGame.DesktopGL_win-x64.7z" "./DeveMazeGeneratorCore.MonoGame.DesktopGL/bin/Release/net8.0/win-x64/Publish/*" '-x!*.pdb'
- uses: actions/upload-artifact@v4
with:
name: DeveMazeGeneratorCore.MonoGame.DesktopGL_win-x64
path: DeveMazeGeneratorCore.MonoGame.DesktopGL_win-x64.7z
build_windows_monogame_windowsdx:
needs: generate_version_number
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install dependencies
run: dotnet restore DeveMazeGeneratorCore.sln
- name: Build
run: dotnet build DeveMazeGeneratorCore.sln -c Release --no-restore /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}}
- name: Test
run: dotnet test DeveMazeGeneratorCore.sln --no-restore --verbosity normal
- name: Publish
run: dotnet publish ./DeveMazeGeneratorCore.MonoGame.WindowsDX\DeveMazeGeneratorCore.MonoGame.WindowsDX.csproj -r win-x64 -c Release /p:PublishSingleFile=true /p:SelfContained=true /p:IncludeNativeLibrariesForSelfExtract=true /p:PublishTrimmed=false /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}}
- name: Copy files that are missing for some reason
run: |
ls -R DeveMazeGeneratorCore.MonoGame.WindowsDX/bin/Release/net8.0-windows/win-x64
cp -R DeveMazeGeneratorCore.MonoGame.WindowsDX/bin/Release/net8.0-windows/win-x64/Content/. DeveMazeGeneratorCore.MonoGame.WindowsDX/bin/Release/net8.0-windows/win-x64/publish/Content/
ls -R DeveMazeGeneratorCore.MonoGame.WindowsDX/bin/Release/net8.0-windows/win-x64/Publish
shell: bash
- name: 7zip output
run: |
7z a -t7z -m0=LZMA2 -mmt=on -mx9 -md=1536m -mfb=273 -ms=on -mqs=on -sccUTF-8 "DeveMazeGeneratorCore.MonoGame.WindowsDX_win-x64.7z" "./DeveMazeGeneratorCore.MonoGame.WindowsDX/bin/Release/net8.0-windows/win-x64/Publish/*" '-x!*.pdb'
- uses: actions/upload-artifact@v4
with:
name: DeveMazeGeneratorCore.MonoGame.WindowsDX_win-x64
path: DeveMazeGeneratorCore.MonoGame.WindowsDX_win-x64.7z
build_windows_Android:
needs: generate_version_number
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install workload android
run: |
dotnet workload install android
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Set Android version
uses: damienaicheh/[email protected]
with:
android-manifest-path: ./DeveMazeGeneratorCore.MonoGame.Android/AndroidManifest.xml
version-name: 1.0.${{needs.generate_version_number.outputs.build_number}}
version-code: ${{needs.generate_version_number.outputs.build_number}}
print-file: true
- name: Restore NuGet packages
run: |
nuget restore DeveMazeGeneratorCore/DeveMazeGeneratorCore.csproj
nuget restore DeveMazeGeneratorCore.MonoGame.Core/DeveMazeGeneratorCore.MonoGame.Core.csproj
nuget restore DeveMazeGeneratorCore.MonoGame.Android/DeveMazeGeneratorCore.MonoGame.Android.csproj
- name: Build Android
run: |
#dotnet build DeveMazeGeneratorCore.MonoGame.Android/DeveMazeGeneratorCore.MonoGame.Android.csproj -c Release --no-restore /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}}
#msbuild /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}} /p:AndroidBuildApplicationPackage=true /p:Configuration=Release /p:AndroidPackageFormat=aab /p:AndroidKeyStore=true /p:AndroidSigningKeyAlias=DevedseCert /p:AndroidSigningKeyPass=${{secrets.ANDROIDKEYSTOREPASSWORD}} /p:AndroidSigningKeyStore=DevedseCert.keystore /p:AndroidSigningStorePass=${{secrets.ANDROIDKEYSTOREPASSWORD}} DeveMazeGeneratorCore.MonoGame.Android\DeveMazeGeneratorCore.MonoGame.Android.csproj
msbuild /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}} /p:AndroidBuildApplicationPackage=true /p:Configuration=Release /p:AndroidPackageFormat=aab ${{ github.actor != 'dependabot[bot]' && format('/p:AndroidKeyStore=true /p:AndroidSigningKeyAlias=DevedseCert /p:AndroidSigningKeyPass={0} /p:AndroidSigningKeyStore=DevedseCert.keystore /p:AndroidSigningStorePass={0}', secrets.ANDROIDKEYSTOREPASSWORD) || '' }} DeveMazeGeneratorCore.MonoGame.Android\DeveMazeGeneratorCore.MonoGame.Android.csproj
- name: dotnet test
run: dotnet test DeveMazeGeneratorCore.Tests/DeveMazeGeneratorCore.Tests.csproj -c Release --verbosity normal
# - name: Package sources
# run: |
# 7z a -t7z -m0=LZMA2 -mmt=on -mx9 -md=1536m -mfb=273 -ms=on -mqs=on -sccUTF-8 "./Scripts/Output/DeveMazeGeneratorCore.MonoGame.Android.7z" "DeveMazeGeneratorCore.MonoGame.Android\*" '-x!*.pdb'
# shell: powershell
- uses: actions/upload-artifact@v4
with:
name: DeveMazeGeneratorCore.MonoGame.Android_aab
path: ./DeveMazeGeneratorCore.MonoGame.Android/bin/Release/net8.0-android/devemazegeneratorcoremonogame_android.devemazegeneratorcoremonogame_android-Signed.aab
build_windows_AndroidForFireStick:
needs: generate_version_number
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install workload android
run: |
dotnet workload install android
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Set Android version
uses: damienaicheh/[email protected]
with:
android-manifest-path: ./DeveMazeGeneratorCore.MonoGame.Android/AndroidManifest.xml
version-name: 1.0.${{needs.generate_version_number.outputs.build_number}}
version-code: ${{needs.generate_version_number.outputs.build_number}}
print-file: true
- name: Restore NuGet packages
run: |
nuget restore DeveMazeGeneratorCore/DeveMazeGeneratorCore.csproj
nuget restore DeveMazeGeneratorCore.MonoGame.Core/DeveMazeGeneratorCore.MonoGame.Core.csproj
nuget restore DeveMazeGeneratorCore.MonoGame.Android/DeveMazeGeneratorCore.MonoGame.Android.csproj
- name: Build Android
run: |
#dotnet build DeveMazeGeneratorCore.MonoGame.Android/DeveMazeGeneratorCore.MonoGame.Android.csproj -c Release --no-restore /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}}
#msbuild /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}} /p:AndroidBuildApplicationPackage=true /p:Configuration=Release /p:AndroidPackageFormat=apk /p:AndroidKeyStore=true /p:AndroidSigningKeyAlias=DevedseCert /p:AndroidSigningKeyPass=${{secrets.ANDROIDKEYSTOREPASSWORD}} /p:AndroidSigningKeyStore=DevedseCert.keystore /p:AndroidSigningStorePass=${{secrets.ANDROIDKEYSTOREPASSWORD}} DeveMazeGeneratorCore.MonoGame.Android\DeveMazeGeneratorCore.MonoGame.Android.csproj
msbuild /p:Version=1.0.${{needs.generate_version_number.outputs.build_number}} /p:AndroidBuildApplicationPackage=true /p:Configuration=Release /p:AndroidPackageFormat=apk ${{ github.actor != 'dependabot[bot]' && format('/p:AndroidKeyStore=true /p:AndroidSigningKeyAlias=DevedseCert /p:AndroidSigningKeyPass={0} /p:AndroidSigningKeyStore=DevedseCert.keystore /p:AndroidSigningStorePass={0}', secrets.ANDROIDKEYSTOREPASSWORD) || '' }} DeveMazeGeneratorCore.MonoGame.Android\DeveMazeGeneratorCore.MonoGame.Android.csproj
- name: dotnet test
run: dotnet test DeveMazeGeneratorCore.Tests/DeveMazeGeneratorCore.Tests.csproj -c Release --verbosity normal
# - name: Package sources
# run: |
# 7z a -t7z -m0=LZMA2 -mmt=on -mx9 -md=1536m -mfb=273 -ms=on -mqs=on -sccUTF-8 "./Scripts/Output/DeveMazeGeneratorCore.MonoGame.Android.7z" "DeveMazeGeneratorCore.MonoGame.Android\*" '-x!*.pdb'
# shell: powershell
- uses: actions/upload-artifact@v4
with:
name: DeveMazeGeneratorCore.MonoGame.Android_apk
path: ./DeveMazeGeneratorCore.MonoGame.Android/bin/Release/net8.0-android/devemazegeneratorcoremonogame_android.devemazegeneratorcoremonogame_android-Signed.apk
release_github:
needs: [
generate_version_number,
build_windows_consoleapp,
build_linux_consoleapp,
build_windows,
build_linux,
build_docker,
build_linux_monogame_desktopgl,
build_windows_monogame_desktopgl_onlinux,
build_windows_monogame_desktopgl,
build_windows_monogame_windowsdx,
build_windows_Android,
build_windows_AndroidForFireStick]
runs-on: ubuntu-latest
permissions:
contents: write
if: github.ref == 'refs/heads/master'
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts/
- name: Display structure of downloaded files
run: |
cd ./artifacts/
ls -R
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: 1.0.${{needs.generate_version_number.outputs.build_number}}
release_name: 1.0.${{needs.generate_version_number.outputs.build_number}}
body: |
${{ github.event.head_commit.message }}
draft: false
prerelease: false
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: 1.0.${{needs.generate_version_number.outputs.build_number}}
files: |
./artifacts/DeveMazeGeneratorCore7z/DeveMazeGeneratorCore.7z
./artifacts/DeveMazeGeneratorCoreZip/DeveMazeGeneratorCore.zip
./artifacts/DeveMazeGeneratorCoreNuGet/*.nupkg
./artifacts/DeveMazeGeneratorCoreNuGet/*.snupkg
./artifacts/DeveMazeGeneratorCore.MonoGame.DesktopGL_linux-x64/DeveMazeGeneratorCore.MonoGame.DesktopGL_linux-x64.tar.gz
./artifacts/DeveMazeGeneratorCore.MonoGame.DesktopGL_win-x64_onlinux/DeveMazeGeneratorCore.MonoGame.DesktopGL_win-x64_onlinux.7z
./artifacts/DeveMazeGeneratorCore.MonoGame.DesktopGL_win-x64/DeveMazeGeneratorCore.MonoGame.DesktopGL_win-x64.7z
./artifacts/DeveMazeGeneratorCore.MonoGame.WindowsDX_win-x64/DeveMazeGeneratorCore.MonoGame.WindowsDX_win-x64.7z
./artifacts/DeveMazeGeneratorCore.MonoGame.Android_aab/devemazegeneratorcoremonogame_android.devemazegeneratorcoremonogame_android-Signed.aab
./artifacts/DeveMazeGeneratorCore.MonoGame.Android_apk/devemazegeneratorcoremonogame_android.devemazegeneratorcoremonogame_android-Signed.apk
./artifacts/DeveMazeGeneratorCore.ConsoleApp.Windows/DeveMazeGenerator.ConsoleApp.Untrimmed.exe
./artifacts/DeveMazeGeneratorCore.ConsoleApp.Windows/DeveMazeGenerator.ConsoleApp.Trimmed.exe
./artifacts/DeveMazeGeneratorCore.ConsoleApp.Windows/DeveMazeGenerator.ConsoleApp.TrimmedAot.exe
./artifacts/DeveMazeGeneratorCore.ConsoleApp.Linux/DeveMazeGenerator.ConsoleApp.Untrimmed
./artifacts/DeveMazeGeneratorCore.ConsoleApp.Linux/DeveMazeGenerator.ConsoleApp.Trimmed
./artifacts/DeveMazeGeneratorCore.ConsoleApp.Linux/DeveMazeGenerator.ConsoleApp.TrimmedAot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release_nuget:
needs: [generate_version_number, build_windows, build_linux, build_docker]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
name: DeveMazeGeneratorCoreNuGet
path: ./artifacts/DeveMazeGeneratorCoreNuGet/
- name: Push NuGet
run: dotnet nuget push ./artifacts/DeveMazeGeneratorCoreNuGet/DeveMazeGeneratorCore.1.0.${{needs.generate_version_number.outputs.build_number}}.nupkg -k ${{ secrets.NUGETTOKEN }} -s https://api.nuget.org/v3/index.json
codeqlanalyze:
runs-on: windows-latest
needs: generate_version_number
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'csharp', 'javascript' ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install workload android
run: |
dotnet workload install android
- name: Run tree
run: tree /A
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
- name: Autobuild
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
output: './artifacts'
- name: Run tree2
run: |
tree /A
cd
- name: Upload CodeQL Database as Artifact
uses: actions/upload-artifact@v4
with:
name: CodeQLDatabase-${{ matrix.language }}
path: ${{ runner.temp }}/codeql_databases/${{ matrix.language }}.zip