7

I've spent about an hour searching for an answer to this one and got nowhere, so I am hoping someone on here can help me.

Background

We are currently experimenting with deploying our Xamarin.Forms android app via App Center using the App Center Distribute build task in VSTS.

One of the settings allows you to point at a release notes file in your project which will then be included as part of the email that gets sent out and on the app center release information when you click through to it. This file has to be UTF-8 format.

Question

Is there a way of actually formatting this file so that it displays nicely? I tried to use HTML, this didn't work. When just using a plain text file it ignores any line breaks in the text file and just displays all the text as a continuous string.

I am not after any ground breaking formatting if it's not possible, just wondering if there is a way of formatting so its at least not all one massive line of text.

Thanks in Advance

Gareth

Gaz Winter
  • 2,924
  • 2
  • 25
  • 47
  • Based on the source code, it reads the content as string, I'm afraid that you can't format it, just add simple information for release note. – starian chen-MSFT May 17 '18 at 03:29

3 Answers3

7

You can technically format using markdown. Unfortunately Microsoft thinks the release notes should be a single line string, removing explicit and implicit newlines, as well as escaping \n. Here's a simplified version of the YAML task, showing releaseNotesInput being added using YAML Multiline block scalar syntax that adds a newline to each row.

- 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)

Unfortunately, this resolves as:

#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

with the markdown formatting of only the bold ** wrapped text actually parsing correctly.

I'll keep experimenting... but I have to say that this is some of the saddest markdown formatting support I have ever encountered.

Update

This works:

    releaseNotesInput:  |+

      AppCenterDistribute (iOS UAT)
      ---

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

# for headings does not work, while --- does. The |+ syntax allows the necessary empty lines to trigger lists etc.

greg.arnott
  • 1,622
  • 17
  • 16
2

You can use Markdown for formatting. And by looking at your well formatted post you already seem to know how to use it

Daniel P
  • 3,314
  • 1
  • 36
  • 38
0

I ran into this same problem when trying to add line breaks. The solution was to use double line breaks in the release_notes field (\n\n instead of \n). In my case I'm sending the release_notes field as json, so it becomes \\n\\n.

Stijn VDB
  • 63
  • 1
  • 5