-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpublish.ps1
47 lines (41 loc) · 1.5 KB
/
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
42
43
44
45
46
47
# publishFolder
$publishFolder= $args[0]
# Paths
$rootFolder = (Get-Item -Path "./" -Verbose).FullName
if ([String]::IsNullOrEmpty($publishFolder)) {
$publishFolder = Join-Path $rootFolder "output/publish"
$hasPath = Test-Path($publishFolder)
if (-Not $hasPath) {
new-item -path $rootFolder -name "output/publish" -type directory
}
}
Write-Host ("Publish Output " + $publishFolder)
# List of projects
$projects = (
"tool/KissU.MseServer",
"tool/KissU.Workbench"
)
# Rebuild solution
Set-Location $rootFolder
& dotnet restore -s http://package.kissu.com/nuget/nuget/v3/index.json
Write-Host ("Restore Completed ! ")
# Publish all projects
foreach($project in $projects) {
$projectFolder = Join-Path $rootFolder $project
$projectName = $project.Substring($project.LastIndexOf("/") + 1)
$outputPath = Join-Path $publishFolder ("/" + $projectName)
Set-Location $projectFolder
Write-Host ("Publish " + $projectName)
& dotnet publish ($projectName + ".csproj ") --configuration Release --output $outputPath --nologo --verbosity quiet --no-restore
$issProject = (Get-Item *.iss).Name
if (![string]::IsNullOrEmpty($issProject))
{
Write-Host ("Setup " + $projectName)
$programPath = Join-Path $outputPath ($projectName + ".exe")
$version = (Get-Command $programPath).FileVersionInfo.ProductVersion
& iscc /Qp /DVersion=$version $issProject
}
}
Write-Host ("Publish Completed ! ")
# Go back to the root folder
Set-Location $rootFolder