From 68ae9460d5b1f363a30d78c67b13d36c53a31b33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBy=C5=BAniewski?= Date: Thu, 29 Dec 2022 10:29:58 +0100 Subject: [PATCH] ci: update obs-plugintemplate --- .cmake-format.json | 22 +- .github/scripts/.build.zsh | 149 ++- .github/scripts/.package.zsh | 44 +- .github/scripts/Build-Windows.ps1 | 69 +- .github/scripts/Package-Windows.ps1 | 4 +- .github/scripts/check-cmake.sh | 6 +- .github/scripts/check-format.sh | 18 +- .../scripts/utils.pwsh/Expand-ArchiveExt.ps1 | 12 +- .../scripts/utils.pwsh/Invoke-GitCheckout.ps1 | 2 +- .github/scripts/utils.pwsh/Setup-Host.ps1 | 151 ++- .github/scripts/utils.pwsh/Setup-Obs.ps1 | 77 +- .github/scripts/utils.zsh/check_linux | 37 +- .github/scripts/utils.zsh/check_macos | 6 +- .github/scripts/utils.zsh/check_packages | 1 + .github/scripts/utils.zsh/check_xcnotary | 9 - .github/scripts/utils.zsh/read_codesign_pass | 6 +- .github/scripts/utils.zsh/setup_linux | 87 +- .github/scripts/utils.zsh/setup_macos | 157 +-- .github/scripts/utils.zsh/setup_obs | 133 +-- .github/workflows/main.yml | 65 +- CMakeLists.txt | 81 +- buildspec.json | 110 +- cmake/ObsPluginHelpers.cmake | 555 +++++++--- cmake/bundle/macos/installer-macOS.pkgproj.in | 947 ------------------ cmake/bundle/windows/installer-Windows.iss.in | 1 + 25 files changed, 1123 insertions(+), 1626 deletions(-) delete mode 100644 .github/scripts/utils.zsh/check_xcnotary delete mode 100644 cmake/bundle/macos/installer-macOS.pkgproj.in diff --git a/.cmake-format.json b/.cmake-format.json index 0ccd9bf..eb7d554 100644 --- a/.cmake-format.json +++ b/.cmake-format.json @@ -1,14 +1,16 @@ { - "additional_commands": { - "find_qt": { - "flags": [], - "kwargs": { - "VERSION": "+", - "COMPONENTS": "+", - "COMPONENTS_WIN": "+", - "COMPONENTS_MACOS": "+", - "COMPONENTS_LINUX": "+" - } + "additional_commands": { + "find_qt": { + "flags": [], + "kwargs": { + "COMPONENTS": "+", + "COMPONENTS_WIN": "+", + "COMPONENTS_MACOS": "+", + "COMPONENTS_LINUX": "+" } } + }, + "format": { + "line_width": 100 + } } diff --git a/.github/scripts/.build.zsh b/.github/scripts/.build.zsh index 40b411e..a85e19a 100755 --- a/.github/scripts/.build.zsh +++ b/.github/scripts/.build.zsh @@ -12,9 +12,9 @@ setopt NO_PUSHD_IGNORE_DUPS setopt FUNCTION_ARGZERO ## Enable for script debugging -#setopt WARN_CREATE_GLOBAL -#setopt WARN_NESTED_VAR -#setopt XTRACE +# setopt WARN_CREATE_GLOBAL +# setopt WARN_NESTED_VAR +# setopt XTRACE 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." @@ -36,20 +36,37 @@ build() { local target="${host_os}-${CPUTYPE}" local project_root=${SCRIPT_HOME:A:h:h} local buildspec_file="${project_root}/buildspec.json" + trap '_trap_error' ZERR fpath=("${SCRIPT_HOME}/utils.zsh" ${fpath}) autoload -Uz log_info log_error log_output set_loglevel check_${host_os} setup_${host_os} setup_obs 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.' + return 2 + } + + typeset -g -a skips=() local -i _verbosity=1 - local -r _version='0.0.1' + local -r _version='1.0.0' local -r -a _valid_targets=( macos-x86_64 macos-arm64 macos-universal linux-x86_64 + linux-aarch64 ) local -r -a _valid_configs=(Debug RelWithDebInfo Release MinSizeRel) + if [[ ${host_os} == 'macos' ]] { + local -r -a _valid_generators=(Xcode Ninja 'Unix Makefiles') + local generator="${${CI:+Ninja}:-Xcode}" + } else { + local -r -a _valid_generators=(Ninja 'Unix Makefiles') + local generator='Ninja' + } local -r _usage=" Usage: %B${functrace[1]%:*}%b