diff --git a/.github/actions/build-obs/action.yaml b/.github/actions/build-obs/action.yaml index bda425a32..676a3e1a8 100644 --- a/.github/actions/build-obs/action.yaml +++ b/.github/actions/build-obs/action.yaml @@ -74,7 +74,6 @@ runs: local -a build_args=( --config ${{ inputs.config }} --target linux-${{ inputs.target }} - --generator Ninja ) if (( ${+RUNNER_DEBUG} )) build_args+=(--debug) diff --git a/.github/scripts/.build.zsh b/.github/scripts/.build.zsh index 7670c880f..7410be322 100755 --- a/.github/scripts/.build.zsh +++ b/.github/scripts/.build.zsh @@ -16,27 +16,22 @@ setopt FUNCTION_ARGZERO #setopt WARN_NESTED_VAR #setopt XTRACE +if (( ! ${+CI} )) { + print -u2 -PR "%F{1} ✖︎ ${ZSH_ARGZERO:t:r} requires CI environment.%f" + exit 1 +} + autoload -Uz is-at-least && if ! is-at-least 5.2; then print -u2 -PR "%F{1}${funcstack[1]##*/}:%f Running on Zsh version %B${ZSH_VERSION}%b, but Zsh %B5.2%b is the minimum supported version. Upgrade Zsh to fix this issue." exit 1 fi -TRAPEXIT() { - local return_value=$? - - if (( ${+CI} )) unset NSUnbufferedIO - - return ${return_value} -} - TRAPZERR() { - if (( ${_loglevel:-3} > 2 )) { - print -u2 -PR "${CI:+::error::}%F{1} ✖︎ script execution error%f" - print -PR -e " - Callstack: - ${(j:\n :)funcfiletrace} - " - } + print -u2 -PR "::error::%F{1} ✖︎ script execution error.%f" + print -PR -e " + Callstack: + ${(j:\n :)funcfiletrace} + " exit 2 } @@ -48,91 +43,41 @@ build() { local buildspec_file=${project_root}/buildspec.json fpath=(${SCRIPT_HOME}/utils.zsh ${fpath}) - autoload -Uz log_group log_info log_status log_error log_output set_loglevel check_${host_os} setup_ccache + autoload -Uz log_group log_error log_output check_${host_os} setup_ccache if [[ ! -r ${buildspec_file} ]] { - log_error \ - 'No buildspec.json found. Please create a build specification for your project.' \ - 'A buildspec.json.template file is provided in the repository to get you started.' + log_error 'Missing buildspec.json in project checkout.' return 2 } - typeset -g -a skips=() - local -i verbosity=1 - local -r _version='1.0.0' + local -i debug=0 + + local target local -r -a _valid_targets=( macos-x86_64 macos-arm64 linux-x86_64 ) - local target + local config='RelWithDebInfo' local -r -a _valid_configs=(Debug RelWithDebInfo Release MinSizeRel) local -i codesign=0 - if [[ ${host_os} == linux ]] { - local -r -a _valid_generators=(Ninja 'Unix Makefiles') - local generator='Ninja' - local -r _usage_host=" -%F{yellow} Additional options for Linux builds%f - ----------------------------------------------------------------------------- - %B--generator%b Specify build system to generate - Available generators: - - Ninja - - Unix Makefiles" - } elif [[ ${host_os} == macos ]] { - local -r _usage_host=" -%F{yellow} Additional options for macOS builds%f - ----------------------------------------------------------------------------- - %B-s | --codesign%b Enable codesigning (macOS only)" - } - - local -i _print_config=0 - local -r _usage=" -Usage: %B${functrace[1]%:*}%b