-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuildUi.ps1
More file actions
49 lines (38 loc) · 1.95 KB
/
Copy pathbuildUi.ps1
File metadata and controls
49 lines (38 loc) · 1.95 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
$artifactPath = ".\artifacts\ui\"
$configurationdefault = "Release"
$configuration = Read-Host 'Configuration to build [default: Release] ?'
if (!$configuration -or ($configuration -eq '')) {
$configuration = $configurationdefault
}
Remove-Item "$artifactPath\*" -Recurse -ErrorAction Ignore
# Install gitversion tool
dotnet tool restore
$output = dotnet tool run dotnet-gitversion /nofetch | out-string
# GitVersion
Write-Host $output
$version = $output | ConvertFrom-Json
$assemblyVersion = $version.AssemblySemver
$assemblyFileVersion = $version.AssemblySemver
#$assemblyInformationalVersion = ($version.SemVer + "." + $version.Sha)
$assemblyInformationalVersion = ($version.InformationalVersion)
$nugetVersion = $version.SemVer
Write-Host "assemblyVersion: "$assemblyVersion
Write-Host "assemblyFileVersion: "$assemblyFileVersion
Write-Host "assemblyInformationalVersion: "$assemblyInformationalVersion
Write-Host "nugetVersion: "$nugetVersion
# Restore
Write-Host "Restore"
dotnet restore ".\src\Mammoth.BigBrother.Ui\Mammoth.BigBrother.Ui.csproj" --verbosity m
write-Host "Build UI"
Set-Location ".\src\Mammoth.BigBrother.Ui\Ui"
npm ci --force
#npm audit fix
npm run build
Set-Location "..\..\.."
# Build and Publish the app
dotnet build ".\src\Mammoth.BigBrother.Ui\Mammoth.BigBrother.Ui.csproj" -c $configuration --no-restore /p:AssemblyVersion=$assemblyVersion /p:FileVersion=$assemblyFileVersion /p:InformationalVersion=$assemblyInformationalVersion
dotnet publish ".\src\Mammoth.BigBrother.Ui\Mammoth.BigBrother.Ui.csproj" --no-build /p:Configuration=$configuration /p:DeployOnBuild=true /p:PublishProfile=".\src\Mammoth.BigBrother.Ui\Properties\PublishProfiles\FolderProfile.pubxml"
Copy-Item -Path ".\src\Mammoth.BigBrother.Ui\bin\$configuration\net10.0\publish\*" -Destination $artifactPath -Recurse
Set-Content -Path "$artifactPath\run.cmd" -Value "dotnet Mammoth.BigBrother.Ui.dll"
Write-Host "Operation completed."
Read-Host