我正在使用 Azure DevOps Release 管道来部署 WPF 应用程序。
在 CI 中,我有一个复制文件任务,其目标是 build.artifactstagingdirectory 在我包括的内容中: - src\SolutionDirectory\ProjectDirectory\bin\$(BuildConfiguration)** - src\SolutionDirectory\ProjectDirectory\Release.nuspec - packages\松鼠.windows.1.8.0**
在 CD 中,我有两个 PowerShell 脚本。一个用于封装操作,另一个用于释放
包裹
$exePath = "$(System.DefaultWorkingDirectory)/_ArtifactName/drop/src/SolutionDirectory/ProjectDirectory/bin/Release/Project.exe"
$version =$([System.Diagnostics.FileVersionInfo]::GetVersionInfo($exePath).FileVersion)
nuget pack .\Release.nuspec
-Version $version
-Properties Configuration=Release
-OutputDirectory .\bin\Release\
-BasePath .\bin\Release\
释放
Set-Alias squirrel "$(System.DefaultWorkingDirectory)/_ArtifactName/drop/packages/squirrel.windows.1.**/tools/squirrel.exe"
$exePath = "$(System.DefaultWorkingDirectory)/_ArtifactName/drop/src/SolutionDirectory/ProjectDirectory/bin/Release/Project.exe"
$version =$([System.Diagnostics.FileVersionInfo]::GetVersionInfo($exePath).FileVersion )
squirrel --releasify "$(System.DefaultWorkingDirectory)/_ArtifactName/drop/src/SolutionDirectory/ProjectDirectory/bin/Release/Project.$version.nupkg" --no-msi --releaseDir $(DevDeployDir)
DevDeployDir 是一个指向本地服务器部署目录的变量。
我只能发布 .nupkg。RELEASES 和 Setup.exe 丢失,我还尝试在最后添加一个 Start-Sleep 命令,因为我认为释放过程可能过早停止。不去。
就像 Azure DevOps 上的 powershell 任务开始在后台运行 Squirrel 释放但由于 squirrel 是异步的(我被告知并且查看一些代码似乎是这样的)它立即退出并且只有一个 * *.nupkg。并创建了一个 **-full.nupkg。所以我觉得它开始将包转换为松鼠版本的包,但是在 powershell 命令退出后它停止了。
当我通过服务器驱动器上的 powershell 手动释放时不会发生这种情况我可以看到我的工作目录中的文件按以下顺序生成
**.nupkg **-full.nupkg 删除 **.nupkg 创建安装程序,exe 可选 Setup.msi
如果有人需要更多信息,我很乐意分享。有人知道这是否可以实现?