forked from rogerfar/rdt-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dotnet-publish.ps1
41 lines (27 loc) · 1.13 KB
/
dotnet-publish.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
$utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
$version = (Get-Content "package.json" | ConvertFrom-Json).version
$csProj = "$pwd\server\RdtClient.Web\RdtClient.Web.csproj"
$navbar = "$pwd\client\src\app\navbar\navbar.component.html";
$newCsProj = (Get-Content $csProj) -replace '<Version>.*?<\/Version>', "<Version>$version</Version>"
[System.IO.File]::WriteAllLines($csProj, $newCsProj, $utf8NoBomEncoding)
$newNavbar = (Get-Content $navbar) -replace 'Version .*?<', "Version $version<"
[System.IO.File]::WriteAllLines($navbar, $newNavbar, $utf8NoBomEncoding)
Write-Output "Commit and push now, press any key to continue"
[Console]::ReadKey()
cd client
npm install
ng build --configuration production --output-path=..\server\RdtClient.Web\wwwroot
cd ..
cd server
dotnet build -c Release
dotnet publish -c Release -o ..\out
cd ..
cd out
$location = Get-Location
[string]$Zip = "C:\Program Files\7-Zip\7z.exe"
[array]$arguments = "a", "-tzip", "-y", "$location/../RealDebridClient.zip", "."
& $Zip $arguments
cd ..
Remove-Item -Path out -Recurse -Force
gh-release --assets RealDebridClient.zip
Remove-Item RealDebridClient.zip