Skip to content

Commit

Permalink
Enable debug logging for notarized app workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoy committed Aug 8, 2023
1 parent 2e30888 commit 49c5d61
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
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
12 changes: 8 additions & 4 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,9 +201,9 @@ prepare_export_options_plist() {
}

setup_log_formatter() {
if [[ -n ${ACTIONS_STEP_DEBUG} ]]; then
if [[ ${disable_log_formatting} ]]; then
echo
echo "Debug logging enabled - not prettifying Xcode logs."
echo "Log formatting disabled - not prettifying Xcode logs."
echo
log_formatter='tee'
elif command -v xcbeautify &> /dev/null; then
Expand Down

0 comments on commit 49c5d61

Please sign in to comment.