格式化VSTS中的发行说明部署到App Center构建任务

时间:2018-05-16 07:44:24

标签: azure-devops azure-pipelines visual-studio-app-center

我花了大约一个小时寻找这个问题的答案而无处可去,所以我希望有人可以帮助我。

背景

我们目前正在尝试使用VSTS中的App Center Distribute构建任务通过App Center部署我们的Xamarin.Forms安卓应用。

其中一个设置允许您指向项目中的发布说明文件,该文件随后将作为发送的电子邮件的一部分包含在应用程序中心发布信息中。该文件必须是UTF-8格式。

问题

有没有办法实际格式化这个文件,以便它显示得很好?我尝试使用HTML,这没有用。当只使用纯文本文件时,它会忽略文本文件中的任何换行符,只显示所有文本作为连续字符串。

如果不可能,我不会追求任何突破性的格式,只是想知道是否有一种格式化方式,所以至少不是所有的大量文本。

先谢谢

加雷

3 个答案:

答案 0 :(得分:1)

您可以使用Markdown进行格式化。通过查看格式正确的帖子,您似乎已经知道如何使用它

答案 1 :(得分:0)

您可以使用markdown 技术上格式。不幸的是,Microsoft认为发行说明应为单行字符串,删除显式和隐式的换行符,并转义\n。这是YAML任务的简化版本,显示了releaseNotesInput是使用YAML多行block scalar语法添加的,该语法向每行添加了换行符。

- task: AppCenterDistribute@1
  displayName: AppCenter Distribution iOS Test
  inputs:
    serverEndpoint: AppCenterConnectionName # known as ConnectionName in DevOps
    appSlug: '{name|org}/{app|project}'
    appFile: '$(build.artifactStagingDirectory)/**/*.ipa'
    releaseNotesOption: 'input'
    releaseNotesInput: |+
      #AppCenterDistribute (iOS Test)\n
      \n
      - **Build Number**  : $(build.buildNumber)
      - **Build started** : $(system.pipelineStartTime)
      - **Source Branch** : $(build.sourceBranch)

不幸的是,它解析为:

#AppCenterDistribute (Android Test)\n\n - Build Number : 20181115.13\n - Build started : 2018-11-15 11:42:44+11:00\n - Source Branch : refs/heads/feature/example\n

仅使用加粗**粗体包装的文本的markdown格式才能正确解析。

我将继续尝试...但是我不得不说,这是我所遇到的最可悲的降价格式支持。

更新

这有效:

    releaseNotesInput:  |+

      AppCenterDistribute (iOS UAT)
      ---

      - **Build Number**  : $(build.buildNumber)
      - **Build started** : $(system.pipelineStartTime)
      - **Source Branch** : $(build.sourceBranch)
标题的

#无效,而---的标题无效。 |+语法允许必要的空行触发列表等。

答案 2 :(得分:0)

尝试添加换行符时遇到了同样的问题。解决方案是在release_notes字段中使用双换行符(\n\n而不是\n)。就我而言,我将release_notes字段作为json发送,因此它变为\\n\\n

相关问题