diff --git a/ci_scripts/ci_common.sh b/ci_scripts/ci_common.sh index 4df6e72e8..7ea590172 100755 --- a/ci_scripts/ci_common.sh +++ b/ci_scripts/ci_common.sh @@ -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 } \ No newline at end of file diff --git a/ci_scripts/ci_post_xcodebuild.sh b/ci_scripts/ci_post_xcodebuild.sh index 7c9849bc1..1775750a1 100755 --- a/ci_scripts/ci_post_xcodebuild.sh +++ b/ci_scripts/ci_post_xcodebuild.sh @@ -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