From ab04e2dd68dba74c15f26f9b89bbf88707368c63 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 30 Jun 2026 20:13:15 +0000 Subject: [PATCH 1/2] Add Xcode Cloud TestFlight notes with branch name Generate WhatToTest.en-US.txt in ci_post_xcodebuild.sh after a successful App Store archive so TestFlight builds show which branch was built. Also appends any "What to test:" section from the commit message, matching the convention used by the screenshot workflow. Co-authored-by: Greg --- Bedtime/ci_scripts/ci_post_xcodebuild.sh | 36 ++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 Bedtime/ci_scripts/ci_post_xcodebuild.sh diff --git a/Bedtime/ci_scripts/ci_post_xcodebuild.sh b/Bedtime/ci_scripts/ci_post_xcodebuild.sh new file mode 100755 index 0000000..f382f5a --- /dev/null +++ b/Bedtime/ci_scripts/ci_post_xcodebuild.sh @@ -0,0 +1,36 @@ +#!/bin/sh +set -eu + +# Generate TestFlight "What to Test" notes after a successful archive upload. +# https://developer.apple.com/documentation/xcode/including-notes-for-testers-with-a-beta-release-of-your-app + +if [ -z "${CI_APP_STORE_SIGNED_APP_PATH:-}" ] || [ ! -d "$CI_APP_STORE_SIGNED_APP_PATH" ]; then + exit 0 +fi + +SCRIPT_DIR=$(CDPATH= cd -- "$(dirname "$0")" && pwd) +PROJECT_DIR=$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd) +REPO_ROOT="${CI_PRIMARY_REPOSITORY_PATH:-$(CDPATH= cd -- "$SCRIPT_DIR/../.." && pwd)}" +TESTFLIGHT_DIR="$PROJECT_DIR/TestFlight" +WHAT_TO_TEST_FILE="$TESTFLIGHT_DIR/WhatToTest.en-US.txt" + +BRANCH_NAME="${CI_PULL_REQUEST_SOURCE_BRANCH:-${CI_BRANCH:-${CI_TAG:-unknown}}}" + +mkdir -p "$TESTFLIGHT_DIR" + +{ + printf 'Branch: %s\n\n' "$BRANCH_NAME" + + if [ -d "$REPO_ROOT/.git" ]; then + COMMIT_NOTES=$(git -C "$REPO_ROOT" log -1 --format=%B 2>/dev/null | awk ' + /^What to test:/ { capture=1; next } + capture { print } + ' | sed '/^[[:space:]]*$/d' || true) + + if [ -n "$COMMIT_NOTES" ]; then + printf 'What to test:\n%s\n' "$COMMIT_NOTES" + fi + fi +} > "$WHAT_TO_TEST_FILE" + +echo "ci_post_xcodebuild: wrote TestFlight notes to $WHAT_TO_TEST_FILE" From c1c728a15b607abbbc052cce72f96f29ffe9e4b8 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 30 Jun 2026 20:37:39 +0000 Subject: [PATCH 2/2] Simplify TestFlight notes to branch name only Match the minimal ci_post_xcodebuild pattern: after archive, write Branch: $CI_BRANCH to TestFlight/WhatToTest.en-US.txt. Co-authored-by: Greg --- Bedtime/ci_scripts/ci_post_xcodebuild.sh | 39 ++++-------------------- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/Bedtime/ci_scripts/ci_post_xcodebuild.sh b/Bedtime/ci_scripts/ci_post_xcodebuild.sh index f382f5a..8cf02a4 100755 --- a/Bedtime/ci_scripts/ci_post_xcodebuild.sh +++ b/Bedtime/ci_scripts/ci_post_xcodebuild.sh @@ -1,36 +1,9 @@ -#!/bin/sh +#!/bin/zsh set -eu -# Generate TestFlight "What to Test" notes after a successful archive upload. -# https://developer.apple.com/documentation/xcode/including-notes-for-testers-with-a-beta-release-of-your-app - -if [ -z "${CI_APP_STORE_SIGNED_APP_PATH:-}" ] || [ ! -d "$CI_APP_STORE_SIGNED_APP_PATH" ]; then - exit 0 +if [[ "${CI_XCODEBUILD_ACTION:-}" == "archive" && -d "${CI_APP_STORE_SIGNED_APP_PATH:-}" ]]; then + # what to test + TESTFLIGHT_DIR_PATH=../TestFlight + mkdir -p "$TESTFLIGHT_DIR_PATH" + echo "Branch: $CI_BRANCH" >! "$TESTFLIGHT_DIR_PATH/WhatToTest.en-US.txt" fi - -SCRIPT_DIR=$(CDPATH= cd -- "$(dirname "$0")" && pwd) -PROJECT_DIR=$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd) -REPO_ROOT="${CI_PRIMARY_REPOSITORY_PATH:-$(CDPATH= cd -- "$SCRIPT_DIR/../.." && pwd)}" -TESTFLIGHT_DIR="$PROJECT_DIR/TestFlight" -WHAT_TO_TEST_FILE="$TESTFLIGHT_DIR/WhatToTest.en-US.txt" - -BRANCH_NAME="${CI_PULL_REQUEST_SOURCE_BRANCH:-${CI_BRANCH:-${CI_TAG:-unknown}}}" - -mkdir -p "$TESTFLIGHT_DIR" - -{ - printf 'Branch: %s\n\n' "$BRANCH_NAME" - - if [ -d "$REPO_ROOT/.git" ]; then - COMMIT_NOTES=$(git -C "$REPO_ROOT" log -1 --format=%B 2>/dev/null | awk ' - /^What to test:/ { capture=1; next } - capture { print } - ' | sed '/^[[:space:]]*$/d' || true) - - if [ -n "$COMMIT_NOTES" ]; then - printf 'What to test:\n%s\n' "$COMMIT_NOTES" - fi - fi -} > "$WHAT_TO_TEST_FILE" - -echo "ci_post_xcodebuild: wrote TestFlight notes to $WHAT_TO_TEST_FILE"