finn voorhees

January 9th, 2024

Platform-Specific Release Notes with Xcode Cloud

TestFlight on a Mac and an iPhone

I’ve been using Xcode Cloud as a CI/CD for all my apps since it came out. It has streamlined the release cycle, and since the addition of support for “What to Test” notes in June 2023, you can build and distribute an app to external testers with the click of a button, a git commit, or a terminal command.

When adding Xcode Cloud release workflows to a cross-platform iOS and macOS app, however, I ran into an issue. While you can specify release notes for the build by editing TestFlight/WhatToTest.<LOCALE>.txt, these release notes will be used for all workflows in your project. Because the iOS app was built using SwiftUI and the macOS app was built using AppKit, each had different features to test and bugs that I was fixing, so it didn’t make sense to write the same release notes for each platform. I didn’t really want to have to make separate commits to make builds with unique release notes, so I just submitted an enhancement request (FB13501281), prefixed each line of my release notes with (iOS) or (macOS), and moved on.

To my surprise, however, a few days later I received a response in the feedback app from someone letting me know my suggestion had been passed along to the responsible team, offering a workaround in the meantime:

if [[ "$CI_XCODEBUILD_ACTION" == "archive" ]]; then
    if [[ "$CI_PRODUCT_PLATFORM" == "iOS" ]]; then
        echo "Set WhatToTest notes for iOS"
        mv $CI_PROJECT_FILE_PATH/../TestFlight/iOS-WhatToTest.en-US.txt $CI_PROJECT_FILE_PATH/../TestFlight/WhatToTest.en-US.txt
    elif [[ "$CI_PRODUCT_PLATFORM" == "macOS" ]]; then
        echo "Set WhatToTest notes for macOS"
        mv $CI_PROJECT_FILE_PATH/../TestFlight/macOS-WhatToTest.en-US.txt $CI_PROJECT_FILE_PATH/../TestFlight/WhatToTest.en-US.txt

The solution is a custom build script that automatically replaces the contents of WhatToTest.<LOCALE>.txt with the contents of a platform-specific release notes file depending on which platform the running workflow is targeting.

While it would be great to specify a custom path to release notes in each workflow, this script has been working nicely for me and isn’t too much additional setup.