我正在使用Azure DevOps发布管道来部署WPF应用程序。
在CI中,我有一个复制文件任务,其中包含的内容包括:- src\SolutionDirectory\ProjectDirectory\bin\$(BuildConfiguration)** - src\SolutionDirectory\ProjectDirectory\Release.nuspec -packages\sprrel.windows.1.8.0**,目标为build.artifactstagingdirectory。
在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。发行版和Setup.exe都丢失了,我也尝试在最后添加一个Start-睡眠命令,因为我认为发布过程可能会停止early.No go。
就像Azure上的powershell任务一样,DevOps开始在后台运行松鼠发布版,但由于松鼠是异步的(有人告诉我,并查看了一些代码,它似乎是这样的),它马上就会退出,只有一个**.nupkg。一个**-完整的。因此,我觉得它开始将包转换成一个松鼠版本版本的包,但是它在powershell命令退出之后停止了。
当我通过服务器上的powershell手动发布时,driveI可以看到我的工作目录中的文件按以下顺序生成时,不会发生这种情况。
**.nupkg **-完全删除**.nupkg创建安装程序,exe可选Setup.msi
如果有人需要更多的信息,我很乐意分享。有人知道这是否可以实现吗?
发布于 2020-03-24 23:39:59
@Mahdi Khalili
是的,它需要一个语义版本,这不是在安装期间,而是在发布期间,所以松鼠日志不会在这里工作,我不认为。
我们只是将等待和通过参数传递给发布过程的powershell包装器。后来一切都成功了。
https://stackoverflow.com/questions/53084046
复制相似问题