From d8386a93f41a1bfa1d301833c72200c6abd176b5 Mon Sep 17 00:00:00 2001 From: Dominik Kapusta Date: Tue, 8 Aug 2023 11:51:36 +0200 Subject: [PATCH] Disable log formatting in notarized build workflow when run with debug logging enabled (#1445) Task/Issue URL: https://app.asana.com/0/1203301625297703/1205226517596953/f Description: Show raw logs when GitHub Actions debug logging is enabled when retrying a workflow. --- .github/workflows/build_notarized.yml | 7 ++++++- scripts/archive.sh | 15 ++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_notarized.yml b/.github/workflows/build_notarized.yml index 8e2c734339..366a4d72ef 100644 --- a/.github/workflows/build_notarized.yml +++ b/.github/workflows/build_notarized.yml @@ -180,6 +180,7 @@ jobs: submodules: recursive - name: Install xcbeautify + if: runner.debug != '1' continue-on-error: true run: brew install xcbeautify @@ -198,7 +199,11 @@ jobs: export APPLE_API_KEY_PATH="$RUNNER_TEMP/apple_api_key.pem" echo -n "$APPLE_API_KEY_BASE64" | base64 --decode -o $APPLE_API_KEY_PATH - ./scripts/archive.sh ${{ env.release-type }} + if [[ "${{ runner.debug }}" == "1" ]]; then + ./scripts/archive.sh ${{ env.release-type }} -r + else + ./scripts/archive.sh ${{ env.release-type }} + fi - name: Set app name and version id: set-outputs diff --git a/scripts/archive.sh b/scripts/archive.sh index 4a61ce58ac..2ed3ca2b30 100755 --- a/scripts/archive.sh +++ b/scripts/archive.sh @@ -15,12 +15,13 @@ print_usage_and_exit() { cat <<- EOF Usage: - $ $(basename "$0") [-a ] [-d] [-s] [-v ] + $ $(basename "$0") [-a ] [-d] [-s] [-r] [-v ] Options: -a Update Asana task after building the app (implies -d) -d Create a DMG image alongside the zipped app and dSYMs -h Print this message + -r Show raw output (don't use xcpretty or xcbeautify) -s Skip xcodebuild output in logs -v Override app version with (does not update Xcode project) @@ -68,7 +69,7 @@ read_command_line_arguments() { shift 1 - while getopts 'a:dhsv:' OPTION; do + while getopts 'a:dhrsv:' OPTION; do case "${OPTION}" in a) asana_task_url="${OPTARG}" @@ -82,6 +83,9 @@ read_command_line_arguments() { h) print_usage_and_exit ;; + r) + disable_log_formatting=1 + ;; s) # Use silent_output function to redirect all output to /dev/null filter_output='silent_output' @@ -197,7 +201,12 @@ prepare_export_options_plist() { } setup_log_formatter() { - if command -v xcbeautify &> /dev/null; then + if [[ ${disable_log_formatting} ]]; then + echo + echo "Log formatting disabled - not prettifying Xcode logs." + echo + log_formatter='tee' + elif command -v xcbeautify &> /dev/null; then log_formatter='xcbeautify' elif command -v xcpretty &> /dev/null; then log_formatter='xcpretty'