Fixes #2104 - Expose changelog (git diffs since the last tag) on Xcode Cloud builds / Testflight

This commit is contained in:
Stefan Ceriu 2024-01-25 12:34:56 +02:00 committed by GitHub
parent 550db5e377
commit b00295151e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 35 additions and 0 deletions

View File

@ -56,4 +56,37 @@ setup_github_actions_translations_environment() {
brew update && brew install swiftgen mint localazy/tools/localazy
mint install Asana/locheck
}
generate_what_to_test_notes() {
if [[ -d "$CI_APP_STORE_SIGNED_APP_PATH" ]]; then
TESTFLIGHT_DIR_PATH=TestFlight
TESTFLIGHT_NOTES_FILE_NAME=WhatToTest.en-US.txt
# Xcode Cloud shallow clones the repo, we need to manually fetch the tags
git fetch --tags --quiet
LATEST_TAG=""
if [ "$CI_WORKFLOW" = "Release" ]; then
# Use -v to invert grep, searching for non-nightlies
LATEST_TAG=$(git tag --sort=-creatordate | grep -v 'nightly' | head -n1)
elif [ "$CI_WORKFLOW" = "Nightly" ]; then
LATEST_TAG=$(git tag --sort=-creatordate | grep 'nightly' | head -n1)
fi
if [[ -z "$LATEST_TAG" ]]; then
echo "generate_what_to_test_notes: Failed fetching previous tag"
return 0 # Continue even though this failed
fi
echo "generate_what_to_test_notes: latest tag is $LATEST_TAG"
mkdir $TESTFLIGHT_DIR_PATH
NOTES=$(git log --pretty='- %an: %s' "$LATEST_TAG"..HEAD)
echo "generate_what_to_test_notes: Generated notes:\n$NOTES"
echo $NOTES > $TESTFLIGHT_DIR_PATH/$TESTFLIGHT_NOTES_FILE_NAME
fi
}

View File

@ -8,6 +8,8 @@ setup_xcode_cloud_environment
# Perform this step before releasing to github in case it fails.
bundle exec fastlane upload_dsyms_to_sentry dsym_path:"$CI_ARCHIVE_PATH/dSYMs"
generate_what_to_test_notes
if [ "$CI_WORKFLOW" = "Release" ]; then
install_xcode_cloud_python_dependencies