22
schangxiang@126.com
2025-05-20 7dccff98bbdf39624cc9430436833db968f1e80e
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
# 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 = (
    "src/CMS.Plugin.PipeLineLems"
)
 
# Rebuild solution
Set-Location $rootFolder
dotnet restore -s https://nexus.sycdev.com/repository/nuget-hosted/  --runtime win-x64
# dotnet restore --configfile NuGet.config  --runtime win-x64
Write-Host ("Restore Completed ! ")
# Publish all projects
foreach($project in $projects) {
    $projectFolder = Join-Path $rootFolder $project
    $projectName = $project.Substring($project.LastIndexOf("/") + 1)
    Set-Location $projectFolder
    Write-Host ("Publish " + $projectName)
   #  & dotnet publish ($projectName + ".csproj ") --configuration Release --output (Join-Path $publishFolder ("/" + $projectName.ToLower()))  --nologo --verbosity quiet --no-restore
    & dotnet publish ($projectName + ".csproj ") --configuration Release --output (Join-Path $publishFolder ("/" + $projectName.ToLower()))  --nologo --verbosity quiet --no-restore  --runtime win-x64
}
 
Write-Host ("Publish Completed ! ")
 
# Go back to the root folder
Set-Location $rootFolder