-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish.ps1
More file actions
51 lines (43 loc) · 1.79 KB
/
publish.ps1
File metadata and controls
51 lines (43 loc) · 1.79 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
# Big thanks to Teemaw for putting this together !
param(
[string]$Configuration = "Release",
[string]$ProjectPath = ".\GDWeave.Sample\ChalkPlusPlus.csproj",
[string]$GDWeavePath = "C:\Program Files (x86)\Steam\steamapps\common\WEBFISHING\GDWeave"
)
# Clean and build
$env:GDWeavePath = $GDWeavePath
dotnet clean $ProjectPath --configuration $Configuration
dotnet restore $ProjectPath
dotnet build $ProjectPath --configuration $Configuration --no-restore
# Update Thunderstore manifest
$ThunderstoreManifestPath = ".\thunderstore\manifest.json"
$GDWeaveManifestPath = ".\GDWeave.Sample\manifest.json"
$version = (Get-Content $GDWeaveManifestPath | ConvertFrom-Json).Metadata.Version
$manifest = Get-Content $ThunderstoreManifestPath | ConvertFrom-Json
$manifest.version_number = $version
$manifest | ConvertTo-Json -Depth 1 | Set-Content $ThunderstoreManifestPath
Move-Item ".\gdscripts\Chalk++.pck" ".\thunderstore\GDWeave\mods"
Move-Item ".\GDWeave.Sample\bin\Release\net8.0\Chalk++.dll" ".\thunderstore\GDWeave\mods"
Move-Item ".\GDWeave.Sample\bin\Release\net8.0\manifest.json" ".\thunderstore\GDWeave\mods"
# Zip it up
$gitTagOrHash = if (git describe --exact-match --tags HEAD 2>$null) {
git describe --exact-match --tags HEAD
} else {
git rev-parse --short HEAD
}
$zipPath = ".\Chalk++_$gitTagOrHash.zip"
Compress-Archive -Path @(
".\thunderstore\GDWeave",
".\thunderstore\icon.png",
".\thunderstore\manifest.json",
".\thunderstore\CHANGELOG.md",
".\thunderstore\README.md"
".\thunderstore\LICENSE"
) -DestinationPath $zipPath -Force
rm ".\thunderstore\GDWeave\mods\Chalk++.pck"
rm ".\thunderstore\GDWeave\mods\Chalk++.dll"
rm ".\thunderstore\GDWeave\mods\manifest.json"
if ($LASTEXITCODE -ne 0) {
Write-Error "Build failed LASTEXITCODE=$LASTEXITCODE"
exit $LASTEXITCODE
}