-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpublish.ps1
More file actions
77 lines (56 loc) · 1.99 KB
/
publish.ps1
File metadata and controls
77 lines (56 loc) · 1.99 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
### Required startup parameters
Param(
[Parameter(Mandatory=$true)]
[string]$Version,
[Parameter(Mandatory=$true)]
[string]$CliVersion,
[Parameter(Mandatory=$true)]
[ValidateSet("win-x64", "osx-arm64", "osx-x64", "linux-x64")]
[string]$Rid,
[string]$ReadyToRun = $false
)
### Configuration
$configuration = "Release";
$solution = Join-Path "." "ImageMagitek.slnx"
$tileshopProject = Join-Path "." "TileShop.UI" "TileShop.UI.csproj"
$tileshopCliProject = Join-Path "." "TileShop.CLI" "TileShop.CLI.csproj"
$testProjects = @(
Join-Path "." "ImageMagitek.UnitTests" "ImageMagitek.UnitTests.csproj"
)
$publishPath = Join-Path "." "publish" $Rid;
$tileshopPublishPath = Join-Path $publishPath "TileShop"
$tileshopCliPublishPath = Join-Path $publishPath "TileShopCLI"
$tileshopZipName = "TileShop-$Rid.v$Version.zip"
$tileshopCliZipName = "TileShopCLI-$Rid.v$CliVersion.zip"
if ($CliVersion -eq $null) {
$CliVersion = $Version
}
### Clean
dotnet clean $solution -c $configuration
### Test
dotnet build $solution -c $configuration
foreach ($testProject in $testProjects) {
dotnet test $testProject --configuration $configuration
}
### Build TileShop.UI
dotnet build $tileshopProject -c $configuration --runtime $Rid --self-contained true
dotnet publish $tileshopProject `
-c $configuration `
--runtime $Rid `
--self-contained true `
--no-build `
--no-restore `
-p:PublishSingleFile=true `
-o $tileshopPublishPath
Compress-Archive -Path $tileshopPublishPath -DestinationPath (Join-Path $publishPath $tileshopZipName)
### Build TileShop.CLI
dotnet build $tileshopCliProject -c $configuration --runtime $Rid --self-contained true
dotnet publish $tileshopCliProject `
-c $configuration `
--runtime $Rid `
--self-contained true `
--no-build `
--no-restore `
-p:PublishSingleFile=true `
-o $tileshopCliPublishPath
Compress-Archive -Path $tileshopCliPublishPath -DestinationPath (Join-Path $publishPath $tileshopCliZipName)