Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable log formatting in notarized build workflow when run with debug logging enabled #1445

Merged
merged 2 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/build_notarized.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ jobs:
submodules: recursive

- name: Install xcbeautify
if: runner.debug != '1'
continue-on-error: true
run: brew install xcbeautify

Expand All @@ -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
Expand Down
15 changes: 12 additions & 3 deletions scripts/archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ print_usage_and_exit() {

cat <<- EOF
Usage:
$ $(basename "$0") <review|release|review-sandbox|release-sandbox> [-a <asana_task_url>] [-d] [-s] [-v <version>]
$ $(basename "$0") <review|release|review-sandbox|release-sandbox> [-a <asana_task_url>] [-d] [-s] [-r] [-v <version>]

Options:
-a <asana_task_url> 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 <version> Override app version with <version> (does not update Xcode project)

Expand Down Expand Up @@ -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}"
Expand All @@ -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'
Expand Down Expand Up @@ -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'
Expand Down
Loading