虚假构建无法获得所需的 Zip 文件结构

Fake build unable to get desired Zip file structure

我想从 .net 核心网络应用程序发布创建一个 zip 文件,该应用程序当前发布到 _artifacts/MyApp 文件夹,但我似乎无法创建所需的 zip 文件结构。

发布的输出是任何 aspnet 核心应用程序的标准

_artifacts/MyApp
_artifacts/MyApp/wwwroot
_artifacts/MyApp/<dlls, config and other output>

我把 MyApp 的根作为我的 zip 文件的根,类似于

/wwwroot
/<dlls, config and other output>

我尝试了以下内容,但它在 zip 中包含文件夹 _artifacts/MyApp,我不知道我哪里做错了,或者是否可以使用此工具来完成

 [ !! "_artifacts/MyApp/*"
        |> Zip.filesAsSpecs "_artifacts/MyApp"
        |> Zip.moveToFolder ""
    ]
    |> Seq.concat
    |> Zip.zipSpec "Deploy.zip"

据我了解文档,关键参数是 workingDir on Zip.filesAsSpecs on https://fake.build/apidocs/v5/fake-io-zip.html

为此,您可以在同一模块中使用 Zip.zip 函数: Zip.zip workingDir fileName files.

在这种情况下,它会是这样的 Zip.zip deployDir "Deploy.zip" !!(deployDir + @"\**\**").