在 VSTS 中格式化发行说明部署到 App Center 构建任务
Formatting Release notes in VSTS Deploy to App Center build task
我花了大约一个小时来寻找这个问题的答案,但一无所获,所以我希望这里有人能帮助我。
背景
我们目前正在尝试使用 VSTS 中的 App Center Distribute
构建任务通过 App Center 部署我们的 Xamarin.Forms android 应用程序。
其中一个设置允许您指向项目中的发行说明文件,该文件随后将作为发送的电子邮件的一部分包含在内,并在您点击它时包含在应用程序中心发布信息中。此文件必须是 UTF-8 格式。
问题
有没有一种方法可以真正格式化此文件以使其显示良好?我尝试使用 HTML,但没有用。当只使用纯文本文件时,它会忽略文本文件中的任何换行符,只将所有文本显示为连续字符串。
如果不可能的话,我不会追求任何突破性的格式化,只是想知道是否有一种格式化方式,所以它至少不是一大行文本。
提前致谢
加雷思
您可以使用 Markdown 进行格式化。通过查看格式良好的 post,您似乎已经知道如何使用它
您可以技术上 使用降价格式。不幸的是,Microsoft 认为发行说明应该是单行字符串,删除显式和隐式换行符,以及转义 \n
。这是 YAML 任务的简化版本,显示使用 YAML Multiline block scalar 语法添加 releaseNotesInput
,该语法向每一行添加一个换行符。
- 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)
#
对标题无效,而 ---
有效。
|+
语法允许必要的空行来触发列表等。
我 运行 在尝试添加换行符时遇到了同样的问题。解决方案是在 release_notes 字段中使用双换行符(\n\n
而不是 \n
)。在我的例子中,我将 release_notes 字段作为 json 发送,因此它变为 \n\n
。
我花了大约一个小时来寻找这个问题的答案,但一无所获,所以我希望这里有人能帮助我。
背景
我们目前正在尝试使用 VSTS 中的 App Center Distribute
构建任务通过 App Center 部署我们的 Xamarin.Forms android 应用程序。
其中一个设置允许您指向项目中的发行说明文件,该文件随后将作为发送的电子邮件的一部分包含在内,并在您点击它时包含在应用程序中心发布信息中。此文件必须是 UTF-8 格式。
问题
有没有一种方法可以真正格式化此文件以使其显示良好?我尝试使用 HTML,但没有用。当只使用纯文本文件时,它会忽略文本文件中的任何换行符,只将所有文本显示为连续字符串。
如果不可能的话,我不会追求任何突破性的格式化,只是想知道是否有一种格式化方式,所以它至少不是一大行文本。
提前致谢
加雷思
您可以使用 Markdown 进行格式化。通过查看格式良好的 post,您似乎已经知道如何使用它
您可以技术上 使用降价格式。不幸的是,Microsoft 认为发行说明应该是单行字符串,删除显式和隐式换行符,以及转义 \n
。这是 YAML 任务的简化版本,显示使用 YAML Multiline block scalar 语法添加 releaseNotesInput
,该语法向每一行添加一个换行符。
- 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)
#
对标题无效,而 ---
有效。
|+
语法允许必要的空行来触发列表等。
我 运行 在尝试添加换行符时遇到了同样的问题。解决方案是在 release_notes 字段中使用双换行符(\n\n
而不是 \n
)。在我的例子中,我将 release_notes 字段作为 json 发送,因此它变为 \n\n
。