首页 > 解决方案 > squirrel.windows 1.7.8-1.9.0 无法在 -releaseDir 中生成 Setup.exe 和 RELEASES 文件

问题描述

我正在使用 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

如果有人需要更多信息,我很乐意分享。有人知道这是否可以实现?

链接到 GitHub 公开问题

标签: azure-devopscontinuous-deploymentsquirrel.windows

解决方案


@马赫迪哈利利

是的,它需要是一个语义版本,这不是在安装期间而是在发布期间,所以我认为松鼠日志在这里不起作用。

我们只是在释放过程中使用了等待并将 thru 参数传递给 powershell 包装器。之后这一切都奏效了。


推荐阅读