format script

"I just thinks it looks better like this"
This commit is contained in:
ebbit1q 2025-10-11 00:50:48 +02:00
parent 4a0b44cda6
commit 6e5eef6082
2 changed files with 25 additions and 16 deletions

View file

@ -11,6 +11,7 @@
# --debug or --release sets the build type ie CMAKE_BUILD_TYPE # --debug or --release sets the build type ie CMAKE_BUILD_TYPE
# --ccache [<size>] uses ccache and shows stats, optionally provide size # --ccache [<size>] uses ccache and shows stats, optionally provide size
# --dir <dir> sets the name of the build dir, default is "build" # --dir <dir> sets the name of the build dir, default is "build"
# --target-macos-version <version> sets the min os version - only used for macOS builds
# uses env: BUILDTYPE MAKE_INSTALL MAKE_PACKAGE PACKAGE_TYPE PACKAGE_SUFFIX MAKE_SERVER MAKE_TEST USE_CCACHE CCACHE_SIZE BUILD_DIR CMAKE_GENERATOR TARGET_MACOS_VERSION # uses env: BUILDTYPE MAKE_INSTALL MAKE_PACKAGE PACKAGE_TYPE PACKAGE_SUFFIX MAKE_SERVER MAKE_TEST USE_CCACHE CCACHE_SIZE BUILD_DIR CMAKE_GENERATOR TARGET_MACOS_VERSION
# (correspond to args: --debug/--release --install --package <package type> --suffix <suffix> --server --test --ccache <ccache_size> --dir <dir>) # (correspond to args: --debug/--release --install --package <package type> --suffix <suffix> --server --test --ccache <ccache_size> --dir <dir>)
# exitcode: 1 for failure, 3 for invalid arguments # exitcode: 1 for failure, 3 for invalid arguments
@ -79,6 +80,15 @@ while [[ $# != 0 ]]; do
BUILD_DIR="$1" BUILD_DIR="$1"
shift shift
;; ;;
'--target-macos-version')
shift
if [[ $# == 0 ]]; then
echo "::error file=$0::--target-macos-version expects an argument"
exit 3
fi
TARGET_MACOS_VERSION="$1"
shift
;;
*) *)
echo "::error file=$0::unrecognized option: $1" echo "::error file=$0::unrecognized option: $1"
exit 3 exit 3
@ -141,28 +151,27 @@ function ccachestatsverbose() {
if [[ $RUNNER_OS == macOS ]]; then if [[ $RUNNER_OS == macOS ]]; then
if [[ $TARGET_MACOS_VERSION ]]; then if [[ $TARGET_MACOS_VERSION ]]; then
# CMAKE_OSX_DEPLOYMENT_TARGET is a vanilla cmake flag needed to compile to target macOS version # CMAKE_OSX_DEPLOYMENT_TARGET is a vanilla cmake flag needed to compile to target macOS version
flags+=("-DCMAKE_OSX_DEPLOYMENT_TARGET=${TARGET_MACOS_VERSION}") flags+=("-DCMAKE_OSX_DEPLOYMENT_TARGET=$TARGET_MACOS_VERSION")
# vcpkg dependencies need a vcpkg triplet file to compile to the target macOS version # vcpkg dependencies need a vcpkg triplet file to compile to the target macOS version
# an easy way is to copy the x64-osx.cmake file and modify it # an easy way is to copy the x64-osx.cmake file and modify it
TRIPLETS_DIR="../cmake/triplets" triplets_dir="/tmp/cmake/triplets"
mkdir -p "$TRIPLETS_DIR" triplet_version=${TARGET_MACOS_VERSION//./-}
# Replace dots with hyphens in triplet name for vcpkg compatibility triplet_file="$triplets_dir/x64-osx-$triplet_version.cmake"
TRIPLET_VERSION=$(echo "${TARGET_MACOS_VERSION}" | sed 's/\./-/g') mkdir -p "$triplets_dir"
TRIPLET_FILE="$TRIPLETS_DIR/x64-osx-${TRIPLET_VERSION}.cmake" cp "../vcpkg/triplets/x64-osx.cmake" "$triplet_file"
cp ../vcpkg/triplets/x64-osx.cmake "$TRIPLET_FILE" echo "set(VCPKG_CMAKE_SYSTEM_VERSION $TARGET_MACOS_VERSION)" >>"$triplet_file"
echo "set(VCPKG_CMAKE_SYSTEM_VERSION ${TARGET_MACOS_VERSION})" >> "$TRIPLET_FILE" echo "set(VCPKG_OSX_DEPLOYMENT_TARGET $TARGET_MACOS_VERSION)" >>"$triplet_file"
echo "set(VCPKG_OSX_DEPLOYMENT_TARGET ${TARGET_MACOS_VERSION})" >> "$TRIPLET_FILE" flags+=("-DVCPKG_OVERLAY_TRIPLETS=$triplets_dir")
flags+=("-DVCPKG_OVERLAY_TRIPLETS=$TRIPLETS_DIR") flags+=("-DVCPKG_TARGET_TRIPLET=x64-osx-$triplet_version")
flags+=("-DVCPKG_TARGET_TRIPLET=x64-osx-${TRIPLET_VERSION}") echo "::group::Generated triplet $triplet_file"
echo "::group::Generated triplet $TRIPLET_FILE" cat "$triplet_file"
cat "$TRIPLET_FILE"
echo "::endgroup::" echo "::endgroup::"
fi fi
echo "::group::Signing Certificate" echo "::group::Signing Certificate"
if [[ -n "$MACOS_CERTIFICATE_NAME" ]]; then if [[ -n "$MACOS_CERTIFICATE_NAME" ]]; then
echo "$MACOS_CERTIFICATE" | base64 --decode > certificate.p12 echo "$MACOS_CERTIFICATE" | base64 --decode >"certificate.p12"
security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
security default-keychain -s build.keychain security default-keychain -s build.keychain
security set-keychain-settings -t 3600 -l build.keychain security set-keychain-settings -t 3600 -l build.keychain

View file

@ -250,6 +250,7 @@ jobs:
xcode: "16.4" xcode: "16.4"
type: Release type: Release
make_package: 1 make_package: 1
override_target: 13
- target: 14 - target: 14
soc: Apple soc: Apple
@ -332,8 +333,7 @@ jobs:
CMAKE_GENERATOR: '${{env.CMAKE_GENERATOR}}' CMAKE_GENERATOR: '${{env.CMAKE_GENERATOR}}'
VCPKG_DISABLE_METRICS: 1 VCPKG_DISABLE_METRICS: 1
VCPKG_BINARY_SOURCES: 'clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite' VCPKG_BINARY_SOURCES: 'clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite'
# if Intel, set the target macOS version to matrix.target, otherwise empty string TARGET_MACOS_VERSION: ${{ matrix.override_target }}
TARGET_MACOS_VERSION: ${{ matrix.soc == 'Intel' && matrix.target || '' }}
run: .ci/compile.sh --server --test --ccache "$CCACHE_SIZE" --vcpkg run: .ci/compile.sh --server --test --ccache "$CCACHE_SIZE" --vcpkg
- name: Sign app bundle - name: Sign app bundle