-
Notifications
You must be signed in to change notification settings - Fork 40
/
makereleases.ps1
560 lines (486 loc) · 19.6 KB
/
makereleases.ps1
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
# Stops the script run in case of any errors.
$ErrorActionPreference = "Stop"
########################## Pipeline #############################
function Run-Pipeline
{
$runtimes = Get-RuntimesToPublishFor
$now = (Get-Date -Format "dddd, dd/MM/yyyy HH:mm:ss K")
$versionName = Read-VersionName
$sw = [System.Diagnostics.Stopwatch]::new()
Show-Greeting -VersionName $versionName -Now $now
Clean-Solution -Stopwatch $sw
Restore-Solution -Stopwatch $sw
Audit-Solution -Stopwatch $sw
Build-Solution -Stopwatch $sw
Run-UnitTests -Stopwatch $sw
Clean-OutputFolder -Stopwatch $sw
Generate-PororocaTestRelease -Stopwatch $sw -VersionName $versionName
foreach ($runtime in $runtimes)
{
Generate-PororocaDesktopRelease -Stopwatch $sw -VersionName $versionName -Runtime $runtime
}
Show-Goodbye
}
function Get-RuntimesToPublishFor
{
# Dropping support for arm releases, starting at version 1.6.0
# This is because we are using AvaloniaEdit.TextMate and TextMateSharp,
# which rely on native C dlls;
# osx-arm64 is now supported (2022-11-30), thanks to AvaloniaEdit version 11.0.0-preview2
# osx-arm64 doesn't work for some reason,
# but osx-x64 works on Mac OSes with Apple Silicon (arm64)
$unixRuntimes = @(`
'linux-x64' `
,'debian-x64' `
#,'linux-arm64' `
,'osx-x64' `
#,'osx-arm64' `
)
$windowsRuntimes = @(`
#'win7-x64' `
#,'win7-x86' `
'win-x64_portable' `
,'win-x86_portable' `
#,'win-arm_portable' `
#,'win-arm64_portable' `
,'win-x64_installer' `
,'win-x86_installer' `
#,'win-arm_installer' `
#,'win-arm64_installer' `
)
# Windows releases should be built on a Windows machine, because of dotnet
# Linux and Mac OS releases should be built on one of those OSs, because of chmod and zip
#return $IsWindows ? $windowsRuntimes : $unixRuntimes
return @("win-x64_installer")
}
#################### Pre-release build and tests ####################
function Show-Greeting
{
param (
[string]$versionName,
[string]$now
)
Write-Host "Pororoca release maker." -ForegroundColor White
Write-Host $now -ForegroundColor DarkGray
Write-Host "Version name: ${versionName}" -ForegroundColor DarkGray
}
function Show-Goodbye
{
Write-Host "Finished!" -ForegroundColor DarkGreen
}
function Clean-Solution
{
param (
[System.Diagnostics.Stopwatch]$stopwatch
)
Write-Host "Cleaning the solution..." -ForegroundColor DarkYellow
$stopwatch.Restart()
dotnet clean --nologo --verbosity quiet
$stopwatch.Stop()
Write-Host "Solution cleaned ($($stopwatch.Elapsed.TotalSeconds.ToString("#"))s)." -ForegroundColor DarkGreen
}
function Restore-Solution
{
param (
[System.Diagnostics.Stopwatch]$stopwatch
)
Write-Host "Restoring the solution..." -ForegroundColor DarkYellow
$stopwatch.Restart()
dotnet restore --nologo --verbosity quiet
$stopwatch.Stop()
Write-Host "Solution restored ($($stopwatch.Elapsed.TotalSeconds.ToString("#"))s)." -ForegroundColor DarkGreen
}
function Audit-Solution
{
param (
[System.Diagnostics.Stopwatch]$stopwatch
)
Write-Host "Auditing the solution..." -ForegroundColor DarkYellow
$stopwatch.Restart()
$jsonObj = (dotnet list package --vulnerable --include-transitive --format json) | ConvertFrom-Json;
$stopwatch.Stop()
$hasAnyVulnerability = $false;
foreach ($project in $jsonObj.projects)
{
if ($project.frameworks -ne $null) { $hasAnyVulnerability = $true; Break; }
}
if ($hasAnyVulnerability)
{
Write-Host "Vulnerabilities found ($($stopwatch.Elapsed.TotalSeconds.ToString("#"))s)." -ForegroundColor Magenta
Write-Host "They can be ignored if they are only in test projects." -ForegroundColor DarkGray
dotnet list package --vulnerable --include-transitive
}
else
{
Write-Host "No vulnerabilities found ($($stopwatch.Elapsed.TotalSeconds.ToString("#"))s)." -ForegroundColor DarkGreen
}
}
function Build-Solution
{
param (
[System.Diagnostics.Stopwatch]$stopwatch
)
Write-Host "Building the solution..." -ForegroundColor DarkYellow
$stopwatch.Restart()
dotnet build --configuration Release --nologo --verbosity quiet
$stopwatch.Stop()
Write-Host "Solution built ($($stopwatch.Elapsed.TotalSeconds.ToString("#"))s)." -ForegroundColor DarkGreen
}
function Run-UnitTests
{
param (
[System.Diagnostics.Stopwatch]$stopwatch
)
Write-Host "Running unit tests..." -ForegroundColor DarkYellow
$stopwatch.Restart()
dotnet test --configuration Release --nologo --verbosity quiet --filter FullyQualifiedName!~Pororoca.Test.Tests
$stopwatch.Stop()
Write-Host "Solution tests run ($($stopwatch.Elapsed.TotalSeconds.ToString("#"))s)." -ForegroundColor DarkGreen
}
function Clean-OutputFolder
{
param (
[System.Diagnostics.Stopwatch]$stopwatch
)
Write-Host "Cleaning 'out' folder..." -ForegroundColor DarkYellow
$stopwatch.Restart()
[void](Remove-Item "./out/" -Recurse -ErrorAction Ignore)
[void](mkdir "out")
$stopwatch.Stop()
Write-Host "Output folder cleaned ($($stopwatch.Elapsed.Seconds)s)." -ForegroundColor DarkGreen
}
#################### Release generation ####################
function Read-VersionName
{
[XML]$desktopCsprojXml = Get-Content ./src/Pororoca.Desktop/Pororoca.Desktop.csproj
$versionName = $desktopCsprojXml.Project.PropertyGroup.Version
return $versionName
}
function Generate-PororocaTestRelease {
param (
[System.Diagnostics.Stopwatch]$stopwatch,
[string]$versionName
)
Write-Host "Publishing Pororoca.Test library..." -ForegroundColor DarkYellow
dotnet pack ./src/Pororoca.Test/Pororoca.Test.csproj `
--nologo `
--verbosity quiet `
--configuration Release
Copy-Item -Path "./src/Pororoca.Test/bin/Release/Pororoca.Test.${versionName}.nupkg" `
-Destination "./out/Pororoca.Test.${versionName}.nupkg"
Write-Host "Package created! ($($stopwatch.Elapsed.Seconds)s)." -ForegroundColor DarkGreen
}
function Generate-PororocaDesktopRelease {
param (
[System.Diagnostics.Stopwatch]$stopwatch,
[string]$versionName,
[string]$runtime
)
$fullAppReleaseName = "Pororoca_${versionName}_${runtime}"
$outputFolder = "./out/${fullAppReleaseName}"
$zipName = "${fullAppReleaseName}.zip"
$isInstallOnWindowsRelease = ($runtime -like "*_installer")
$isDebianDpkgRelease = ($runtime -like "debian*")
$dotnetPublishRuntime = $runtime.Replace("_installer","").Replace("_portable","").Replace("debian","linux")
Write-Host "Publishing Pororoca.Desktop for ${runtime}..." -ForegroundColor DarkYellow
$stopwatch.Restart()
Publish-PororocaDesktop -Runtime $dotnetPublishRuntime -IsInstallOnWindowsRelease $isInstallOnWindowsRelease -IsInstallOnDebianRelease $isDebianDpkgRelease -OutputFolder $outputFolder
Rename-Executable -Runtime $runtime -OutputFolder $outputFolder
Set-ExecutableAttributesIfUnix -Runtime $runtime -OutputFolder $outputFolder
Make-AppFolderIfMacOS -Runtime $runtime -OutputFolder $outputFolder
Copy-LogoIfLinux -Runtime $runtime -OutputFolder $outputFolder
Copy-Licence -OutputFolder $outputFolder
Generate-SBOM -OutputFolder $outputFolder
if ($isInstallOnWindowsRelease)
{
Copy-IconIfInstalledOnWindows -Runtime $runtime -OutputFolder $outputFolder
Write-Host "Generating Windows installer for ${runtime}..." -ForegroundColor DarkYellow
Pack-ReleaseInWindowsInstaller -GeneralOutFolder ".\out" -InstallerFilesFolder $outputFolder -InstallerFileName "${fullAppReleaseName}.exe" -VersionName $versionName
$stopwatch.Stop()
Write-Host "Windows installer for ${dotnetPublishRuntime} created: ./out/${fullAppReleaseName}.exe ($($stopwatch.Elapsed.TotalSeconds.ToString("#"))s)." -ForegroundColor DarkGreen
}
elseif ($isDebianDpkgRelease)
{
Write-Host "Generating Debian package for ${runtime}..." -ForegroundColor DarkYellow
Pack-ReleaseInDebianDpkg -GeneralOutFolder "./out" -InstallerFilesFolder $outputFolder -InstallerFileName "${fullAppReleaseName}.dpkg" -VersionName $versionName
$stopwatch.Stop()
Write-Host "Debian package for ${dotnetPublishRuntime} created: ./out/${fullAppReleaseName}.deb ($($stopwatch.Elapsed.TotalSeconds.ToString("#"))s)." -ForegroundColor DarkGreen
}
else
{
Compress-Package -OutputFolder $outputFolder -ZipName $zipName
$stopwatch.Stop()
Write-Host "Package created on ./out/${zipName} ($($stopwatch.Elapsed.TotalSeconds.ToString("#"))s)." -ForegroundColor DarkGreen
Write-Host "SHA256 hash for package ${runtime}: $((Get-FileHash ./out/${zipName} -Algorithm SHA256).Hash)" -ForegroundColor DarkGreen
}
}
function Publish-PororocaDesktop
{
param (
[string]$runtime,
[string]$outputFolder,
[bool]$isInstallOnWindowsRelease = $false,
[bool]$isInstallOnDebianRelease = $false
)
if (($runtime -like "win*portable") -or ($runtime -like "linux*"))
{
# .NET SDK 6.0.3xx and greater allows for single file publishing for Windows 7
# for HTTP/3 to work, we cannot ship as single-file application,
# unless, and only for Windows, if we include msquic.dll next to the generated .exe file
# https://github.com/dotnet/runtime/issues/79727
# update (2023-12-11): let's try single-file publishing for Linux too
# update (2024-10-05): let's leave single-file only for portable releases,
# because single-files are compressed and take a longer time for start-up
$publishSingleFile = $True
}
else
{
$publishSingleFile = $False
}
$publishSingleFileArg = $(${publishSingleFile}.ToString().ToLower())
$isInstallOnWindowsReleaseArg = $(${isInstallOnWindowsRelease}.ToString().ToLower())
$isInstallOnDebianReleaseArg = $(${isInstallOnDebianRelease}.ToString().ToLower())
# set UITestsEnabled to false to hide 'Run UI tests'
dotnet publish ./src/Pororoca.Desktop/Pororoca.Desktop.csproj `
--verbosity quiet `
--nologo `
--configuration Release `
-p:PublishSingleFile=${publishSingleFileArg} `
-p:PublishForInstallOnWindows=${isInstallOnWindowsReleaseArg} `
-p:PublishForInstallOnDebian=${isInstallOnDebianReleaseArg} `
-p:UITestsEnabled=false `
--self-contained true `
--runtime $runtime `
--output $outputFolder
if ($runtime -like "*win*")
{
# let's copy the msquic.dll file next to the generated .exe
Copy-Item -Path "./src/Pororoca.Desktop/bin/Release/net8.0/${runtime}/msquic.dll" `
-Destination $outputFolder
}
}
function Rename-Executable
{
param (
[string]$runtime,
[string]$outputFolder
)
if ($runtime -like "*win*")
{
Rename-Item -Path "${outputFolder}/Pororoca.Desktop.exe" -NewName "Pororoca.exe"
}
else
{
Rename-Item "${outputFolder}/Pororoca.Desktop" -NewName "Pororoca"
}
}
function Set-ExecutableAttributesIfUnix
{
param (
[string]$runtime,
[string]$outputFolder
)
if ($runtime -notlike "*win*")
{
# If this is script is running on Linux or Mac OS,
# lets also set UNIX executable attribute for the program,
# if the target runtime is Linux or Mac OS
if ($IsLinux -or $IsMacOS)
{
chmod +x "${outputFolder}/Pororoca"
}
else
{
Write-Host "Program file will not have UNIX executable attribute.`nRemember to run 'chmod +x' before running." -ForegroundColor Magenta
}
}
}
function Make-AppFolderIfMacOS
{
param (
[string]$runtime,
[string]$outputFolder
)
if ($runtime -like "*osx*")
{
Write-Host "Remember to update Info.plist file with the correct version!" -ForegroundColor Magenta
Write-Host "Creating custom folder structure for Mac OSX .app..." -ForegroundColor DarkYellow
$tempAppOutputFolder = $outputFolder + "_app"
[void](mkdir "$tempAppOutputFolder")
[void](mkdir "$tempAppOutputFolder/Contents")
[void](mkdir "$tempAppOutputFolder/Contents/MacOS")
[void](mkdir "$tempAppOutputFolder/Contents/Resources")
Copy-Item -Path "./src/Pororoca.Desktop.MacOSX/Info.plist" `
-Destination "$tempAppOutputFolder/Contents/"
Copy-Item -Path "./src/Pororoca.Desktop.MacOSX/pororoca.icns" `
-Destination "$tempAppOutputFolder/Contents/Resources/"
Copy-Item -Force -Recurse -Path "$outputFolder/*" -Destination "$tempAppOutputFolder/Contents/MacOS/"
Remove-Item -Recurse -Force -Path "$outputFolder/*"
[void](mkdir "$outputFolder/Pororoca.app")
Copy-Item -Force -Recurse -Path "$tempAppOutputFolder/*" -Destination "$outputFolder/Pororoca.app/"
Remove-Item -Recurse -Force -Path $tempAppOutputFolder
}
}
function Copy-LogoIfLinux
{
param (
[string]$runtime,
[string]$outputFolder
)
if ($runtime -like "*linux*")
{
# Copy logo for users to create launchers
Copy-Item -Path "./pororoca.png" `
-Destination $outputFolder
}
}
function Copy-IconIfInstalledOnWindows
{
param (
[string]$runtime,
[string]$outputFolder
)
if (($runtime -like "*win*") -and ($runtime -like "*_installer*"))
{
# Copy icon for windows installer
Copy-Item -Path "./src/Pororoca.Desktop/Assets/pororoca_icon.ico" `
-Destination $outputFolder
}
}
function Copy-Licence
{
param (
[string]$outputFolder
)
Copy-Item -Path "./LICENCE.md" `
-Destination $outputFolder
}
function Generate-SBOM
{
param (
[string]$outputFolder,
[string]$versionName
)
dotnet CycloneDX ./src/Pororoca.Desktop/Pororoca.Desktop.csproj -o $outputFolder -f sbom.json -sv $versionName --json
}
function Compress-Package
{
param (
[string]$outputFolder,
[string]$zipName
)
if ($IsWindows)
{
Compress-Archive `
-CompressionLevel Optimal `
-Path $outputFolder `
-DestinationPath "./out/${zipName}"
}
else
{
cd $outputFolder
zip -9 -r ../$zipName *
cd ../..
}
Remove-Item $outputFolder -Force -Recurse -ErrorAction Ignore
}
function Pack-ReleaseInWindowsInstaller
{
param (
[string]$generalOutFolder, # the "./out/" folder
[string]$installerFilesFolder, # the "./out/Pororoca_x.y.z_win-x64_installer" folder
[string]$installerFileName,
[string]$versionName
)
$installerOutFileAbsolutePath = $((Resolve-Path $generalOutFolder).ToString()) + "\" + $installerFileName
$installerFilesDirAbsolutePath = $((Resolve-Path $installerFilesFolder).ToString())
# makensis must be added to PATH
# -WX ` # treat warnings as errors
# -V2 ` # verbosity no info
makensis -WX -V2 "/XOutFile ${installerOutFileAbsolutePath}" `
"/DSHORT_VERSION=${versionName}" `
"/DINPUT_FILES_DIR=${installerFilesDirAbsolutePath}" `
.\src\Pororoca.Desktop.WindowsInstaller\Installer.nsi
Remove-Item $installerFilesFolder -Force -Recurse -ErrorAction Ignore
}
function Pack-ReleaseInDebianDpkg
{
param (
[string]$generalOutFolder, # the "./out" folder
[string]$installerFilesFolder, # the "./out/Pororoca_x.y.z_debian-x64/" folder
[string]$installerFileName,
[string]$versionName
)
# https://wiki.freepascal.org/Debian_package_structure
# https://martin.hoppenheit.info/blog/2016/where-to-put-application-icons-on-linux/
[void](mkdir "${generalOutFolder}/deb")
# Debian control file
[void](mkdir "${generalOutFolder}/deb/DEBIAN")
Copy-Item -Path "./src/Pororoca.Desktop.Debian/control" -Destination "${generalOutFolder}/deb/DEBIAN"
# Starter script
[void](mkdir "${generalOutFolder}/deb/usr")
[void](mkdir "${generalOutFolder}/deb/usr/bin")
Copy-Item -Path "./src/Pororoca.Desktop.Debian/pororoca.sh" -Destination "${generalOutFolder}/deb/usr/bin/pororoca"
chmod +x "${generalOutFolder}/deb/usr/bin/pororoca" # set executable permissions to starter script
# Other files
[void](mkdir "${generalOutFolder}/deb/usr/lib")
[void](mkdir "${generalOutFolder}/deb/usr/lib/pororoca")
Copy-Item -Path "${installerFilesFolder}/*" -Destination "${generalOutFolder}/deb/usr/lib/pororoca" -Recurse -Force
chmod -R a+rX "${generalOutFolder}/deb/usr/lib/pororoca/" # set read permissions to all files
chmod +x "${generalOutFolder}/deb/usr/lib/pororoca/Pororoca" # set executable permissions to main executable
# Desktop shortcut
[void](mkdir "${generalOutFolder}/deb/usr/share")
[void](mkdir "${generalOutFolder}/deb/usr/share/applications")
Copy-Item -Path "./src/Pororoca.Desktop.Debian/Pororoca.desktop" -Destination "${generalOutFolder}/deb/usr/share/applications/Pororoca.desktop"
# Desktop icon
# A 32x32 px XPM file in /usr/share/pixmaps/ (using 1024x1024 px PNG instead, like VS Code uses for its icon)
[void](mkdir "${generalOutFolder}/deb/usr/share/pixmaps")
Copy-Item -Path "./src/Pororoca.Desktop.Debian/pororoca_icon_1024px.png" -Destination "${generalOutFolder}/deb/usr/share/pixmaps/pororoca.png"
# Hicolor icons
[void](mkdir "${generalOutFolder}/deb/usr/share/icons")
[void](mkdir "${generalOutFolder}/deb/usr/share/icons/hicolor")
# A 16x16 px PNG file in /usr/share/icons/hicolor/16x16/apps/
[void](mkdir "${generalOutFolder}/deb/usr/share/icons/hicolor/16x16")
[void](mkdir "${generalOutFolder}/deb/usr/share/icons/hicolor/16x16/apps")
Copy-Item -Path "./src/Pororoca.Desktop.Debian/pororoca_icon_16px.png" -Destination "${generalOutFolder}/deb/usr/share/icons/hicolor/16x16/apps/pororoca.png"
# A 32x32 px PNG file in /usr/share/icons/hicolor/32x32/apps/
[void](mkdir "${generalOutFolder}/deb/usr/share/icons/hicolor/32x32")
[void](mkdir "${generalOutFolder}/deb/usr/share/icons/hicolor/32x32/apps")
Copy-Item -Path "./src/Pororoca.Desktop.Debian/pororoca_icon_32px.png" -Destination "${generalOutFolder}/deb/usr/share/icons/hicolor/32x32/apps/pororoca.png"
# A 48x48 px PNG file in /usr/share/icons/hicolor/48x48/apps/
[void](mkdir "${generalOutFolder}/deb/usr/share/icons/hicolor/48x48")
[void](mkdir "${generalOutFolder}/deb/usr/share/icons/hicolor/48x48/apps")
Copy-Item -Path "./src/Pororoca.Desktop.Debian/pororoca_icon_48px.png" -Destination "${generalOutFolder}/deb/usr/share/icons/hicolor/48x48/apps/pororoca.png"
# A 64x64 px PNG file in /usr/share/icons/hicolor/64x64/apps/
[void](mkdir "${generalOutFolder}/deb/usr/share/icons/hicolor/64x64")
[void](mkdir "${generalOutFolder}/deb/usr/share/icons/hicolor/64x64/apps")
Copy-Item -Path "./src/Pororoca.Desktop.Debian/pororoca_icon_64px.png" -Destination "${generalOutFolder}/deb/usr/share/icons/hicolor/64x64/apps/pororoca.png"
# A 128x128 px PNG file in /usr/share/icons/hicolor/128x128/apps/
[void](mkdir "${generalOutFolder}/deb/usr/share/icons/hicolor/128x128")
[void](mkdir "${generalOutFolder}/deb/usr/share/icons/hicolor/128x128/apps")
Copy-Item -Path "./src/Pororoca.Desktop.Debian/pororoca_icon_128px.png" -Destination "${generalOutFolder}/deb/usr/share/icons/hicolor/128x128/apps/pororoca.png"
# A 256x256 px PNG file in /usr/share/icons/hicolor/256x256/apps/
[void](mkdir "${generalOutFolder}/deb/usr/share/icons/hicolor/256x256")
[void](mkdir "${generalOutFolder}/deb/usr/share/icons/hicolor/256x256/apps")
Copy-Item -Path "./src/Pororoca.Desktop.Debian/pororoca_icon_256px.png" -Destination "${generalOutFolder}/deb/usr/share/icons/hicolor/256x256/apps/pororoca.png"
# A 512x512 px PNG file in /usr/share/icons/hicolor/512x512/apps/
[void](mkdir "${generalOutFolder}/deb/usr/share/icons/hicolor/512x512")
[void](mkdir "${generalOutFolder}/deb/usr/share/icons/hicolor/512x512/apps")
Copy-Item -Path "./src/Pororoca.Desktop.Debian/pororoca_icon_512px.png" -Destination "${generalOutFolder}/deb/usr/share/icons/hicolor/512x512/apps/pororoca.png"
# Optionally, an SVG file in /usr/share/icons/hicolor/scalable/apps/
[void](mkdir "${generalOutFolder}/deb/usr/share/icons/hicolor/scalable")
[void](mkdir "${generalOutFolder}/deb/usr/share/icons/hicolor/scalable/apps")
Copy-Item -Path "./misc/pororoca_logo.svg" -Destination "${generalOutFolder}/deb/usr/share/icons/hicolor/scalable/apps/pororoca.svg"
# Make .deb file
dpkg-deb --root-owner-group --build "./out/deb/" "./out/Pororoca_${versionName}_amd64.deb"
# To run Pororoca from the Terminal, on Debian-installed version:
# LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/pororoca pororoca
# To install Pororoca .deb package:
# sudo apt install ./out/pororoca_version_amd64.deb
# To uninstall Pororoca:
# sudo apt remove pororoca
Remove-Item $installerFilesFolder -Force -Recurse -ErrorAction Ignore
Remove-Item "./out/deb" -Force -Recurse -ErrorAction Ignore
}
########################## Execute #############################
Run-Pipeline