mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-09 09:33:57 -07:00
address comments
This commit is contained in:
parent
4414219f72
commit
c0103e0378
3 changed files with 41 additions and 18 deletions
|
|
@ -156,6 +156,18 @@ function ccachestatsverbose() {
|
||||||
|
|
||||||
# Compile
|
# Compile
|
||||||
if [[ $RUNNER_OS == macOS ]]; then
|
if [[ $RUNNER_OS == macOS ]]; then
|
||||||
|
# QTDIR is needed for macOS since we actually only use the cached thin Qt binaries instead of the install-qt-action,
|
||||||
|
# which sets a few environment variables
|
||||||
|
if QTDIR=$(find "$GITHUB_WORKSPACE/Qt" -depth -maxdepth 2 -name macos -type d -print -quit); then
|
||||||
|
echo "found QTDIR at $QTDIR"
|
||||||
|
else
|
||||||
|
echo "could not find QTDIR!"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
# the qtdir is located at Qt/[qtversion]/macos
|
||||||
|
# we use find to get the first subfolder with the name "macos"
|
||||||
|
# this works independent of the qt version as there should be only one version installed on the runner at a time
|
||||||
|
export QTDIR
|
||||||
|
|
||||||
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
|
||||||
|
|
|
||||||
23
.ci/thin_macos_qtlib.sh
Executable file
23
.ci/thin_macos_qtlib.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# The macos binaries from aqt are fat (universal), so we thin them to the target architecture to reduce the size of
|
||||||
|
# the packages and caches using lipo.
|
||||||
|
|
||||||
|
# This script is meant to be used by the ci enironment on macos runners only.
|
||||||
|
# It uses the runner's GITHUB_WORKSPACE env variable.
|
||||||
|
arch=$(uname -m)
|
||||||
|
nproc=$(sysctl -n hw.ncpu)
|
||||||
|
|
||||||
|
function thin() {
|
||||||
|
local libfile=$0
|
||||||
|
if file -b --mime-type "$libfile" | grep -q "application/x-mach-binary"; then
|
||||||
|
echo "Processing $libfile"
|
||||||
|
lipo "$libfile" -thin "$arch" -output "$libfile"
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
export -f thin # export to allow use in xargs
|
||||||
|
|
||||||
|
echo "::group::Thinning Qt libraries to $arch using $nproc cores"
|
||||||
|
find "$GITHUB_WORKSPACE/Qt" -type f -print0 | xargs -0 -n1 -P"$nproc" -I{} bash -c "thin '{}'"
|
||||||
|
echo "::endgroup::"
|
||||||
24
.github/workflows/desktop-build.yml
vendored
24
.github/workflows/desktop-build.yml
vendored
|
|
@ -260,7 +260,7 @@ jobs:
|
||||||
make_package: 1
|
make_package: 1
|
||||||
package_suffix: "-macOS13_Intel"
|
package_suffix: "-macOS13_Intel"
|
||||||
artifact_name: macOS13_Intel-package
|
artifact_name: macOS13_Intel-package
|
||||||
qt_version: 6.6.3
|
qt_version: 6.6.*
|
||||||
qt_arch: clang_64
|
qt_arch: clang_64
|
||||||
qt_modules: qtimageformats qtmultimedia qtwebsockets
|
qt_modules: qtimageformats qtmultimedia qtwebsockets
|
||||||
cmake_generator: Ninja
|
cmake_generator: Ninja
|
||||||
|
|
@ -275,7 +275,7 @@ jobs:
|
||||||
make_package: 1
|
make_package: 1
|
||||||
package_suffix: "-macOS14"
|
package_suffix: "-macOS14"
|
||||||
artifact_name: macOS14-package
|
artifact_name: macOS14-package
|
||||||
qt_version: 6.6.3
|
qt_version: 6.6.*
|
||||||
qt_arch: clang_64
|
qt_arch: clang_64
|
||||||
qt_modules: qtimageformats qtmultimedia qtwebsockets
|
qt_modules: qtimageformats qtmultimedia qtwebsockets
|
||||||
cmake_generator: Ninja
|
cmake_generator: Ninja
|
||||||
|
|
@ -290,7 +290,7 @@ jobs:
|
||||||
make_package: 1
|
make_package: 1
|
||||||
package_suffix: "-macOS15"
|
package_suffix: "-macOS15"
|
||||||
artifact_name: macOS15-package
|
artifact_name: macOS15-package
|
||||||
qt_version: 6.6.3
|
qt_version: 6.6.*
|
||||||
qt_arch: clang_64
|
qt_arch: clang_64
|
||||||
qt_modules: qtimageformats qtmultimedia qtwebsockets
|
qt_modules: qtimageformats qtmultimedia qtwebsockets
|
||||||
cmake_generator: Ninja
|
cmake_generator: Ninja
|
||||||
|
|
@ -302,7 +302,7 @@ jobs:
|
||||||
soc: Apple
|
soc: Apple
|
||||||
xcode: "16.4"
|
xcode: "16.4"
|
||||||
type: Debug
|
type: Debug
|
||||||
qt_version: 6.6.3
|
qt_version: 6.6.*
|
||||||
qt_arch: clang_64
|
qt_arch: clang_64
|
||||||
qt_modules: qtimageformats qtmultimedia qtwebsockets
|
qt_modules: qtimageformats qtmultimedia qtwebsockets
|
||||||
cmake_generator: Ninja
|
cmake_generator: Ninja
|
||||||
|
|
@ -327,7 +327,7 @@ jobs:
|
||||||
make_package: 1
|
make_package: 1
|
||||||
package_suffix: "-Win10"
|
package_suffix: "-Win10"
|
||||||
artifact_name: Windows10-installer
|
artifact_name: Windows10-installer
|
||||||
qt_version: 6.6.3
|
qt_version: 6.6.*
|
||||||
qt_arch: win64_msvc2019_64
|
qt_arch: win64_msvc2019_64
|
||||||
qt_modules: qtimageformats qtmultimedia qtwebsockets
|
qt_modules: qtimageformats qtmultimedia qtwebsockets
|
||||||
cmake_generator: "Visual Studio 17 2022"
|
cmake_generator: "Visual Studio 17 2022"
|
||||||
|
|
@ -381,19 +381,9 @@ jobs:
|
||||||
modules: ${{matrix.qt_modules}}
|
modules: ${{matrix.qt_modules}}
|
||||||
dir: ${{github.workspace}}
|
dir: ${{github.workspace}}
|
||||||
|
|
||||||
# the binaries from aqt are fat (universal), so we thin them to the target architecture to reduce the size of the packages and caches
|
|
||||||
- name: Thin Qt ${{matrix.qt_version}} libraries
|
- name: Thin Qt ${{matrix.qt_version}} libraries
|
||||||
if: matrix.os == 'macOS' && steps.restore_qt.outputs.cache-hit != 'true'
|
if: matrix.os == 'macOS' && steps.restore_qt.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: .ci/thin_macos_qtlib.sh
|
||||||
export ARCH=$(uname -m)
|
|
||||||
export NPROC=$(sysctl -n hw.ncpu)
|
|
||||||
echo "::group::Thinning Qt libraries to $ARCH using $NPROC cores"
|
|
||||||
find ${{ github.workspace }}/Qt -type f -print0 | \
|
|
||||||
xargs -0 -n1 -P "$NPROC" sh -c \
|
|
||||||
'file -b --mime-type "$0" | grep -q "application/x-mach-binary" && \
|
|
||||||
echo "Processing $0" && \
|
|
||||||
lipo "$0" -thin "$ARCH" -output "$0" || true'
|
|
||||||
echo "::endgroup::"
|
|
||||||
|
|
||||||
- name: Cache thin Qt ${{matrix.qt_version}} libraries
|
- name: Cache thin Qt ${{matrix.qt_version}} libraries
|
||||||
if: matrix.os == 'macOS' && steps.restore_qt.outputs.cache-hit != 'true'
|
if: matrix.os == 'macOS' && steps.restore_qt.outputs.cache-hit != 'true'
|
||||||
|
|
@ -437,8 +427,6 @@ jobs:
|
||||||
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
|
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
|
||||||
DEVELOPER_DIR: '/Applications/Xcode_${{matrix.xcode}}.app/Contents/Developer'
|
DEVELOPER_DIR: '/Applications/Xcode_${{matrix.xcode}}.app/Contents/Developer'
|
||||||
TARGET_MACOS_VERSION: ${{ matrix.override_target }}
|
TARGET_MACOS_VERSION: ${{ matrix.override_target }}
|
||||||
# QTDIR is needed for macOS since we actually only use the cached thin Qt binaries instead of the install-qt-action, which sets a few environment variables
|
|
||||||
QTDIR: ${{ matrix.os == 'macOS' && format('{0}/Qt/{1}/macos', github.workspace, matrix.qt_version) || '' }}
|
|
||||||
run: .ci/compile.sh --server --test --vcpkg
|
run: .ci/compile.sh --server --test --vcpkg
|
||||||
|
|
||||||
- name: Sign app bundle
|
- name: Sign app bundle
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue