mirror of https://github.com/OpenTTD/OpenTTD.git
Feature: Build macOS build as a universal binary
This commit is contained in:
parent
0e62a398c7
commit
ce42e819b9
|
@ -360,15 +360,6 @@ jobs:
|
||||||
name: MacOS
|
name: MacOS
|
||||||
needs: source
|
needs: source
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- arch: x64
|
|
||||||
full_arch: x86_64
|
|
||||||
- arch: arm64
|
|
||||||
full_arch: arm64
|
|
||||||
|
|
||||||
runs-on: macos-10.15
|
runs-on: macos-10.15
|
||||||
env:
|
env:
|
||||||
MACOSX_DEPLOYMENT_TARGET: 10.9
|
MACOSX_DEPLOYMENT_TARGET: 10.9
|
||||||
|
@ -397,8 +388,7 @@ jobs:
|
||||||
vcpkgDirectory: '/usr/local/share/vcpkg'
|
vcpkgDirectory: '/usr/local/share/vcpkg'
|
||||||
doNotUpdateVcpkg: false
|
doNotUpdateVcpkg: false
|
||||||
vcpkgGitCommitId: 2a42024b53ebb512fb5dd63c523338bf26c8489c
|
vcpkgGitCommitId: 2a42024b53ebb512fb5dd63c523338bf26c8489c
|
||||||
vcpkgArguments: 'freetype liblzma lzo'
|
vcpkgArguments: 'freetype:x64-osx liblzma:x64-osx lzo:x64-osx freetype:arm64-osx liblzma:arm64-osx lzo:arm64-osx'
|
||||||
vcpkgTriplet: '${{ matrix.arch }}-osx'
|
|
||||||
|
|
||||||
- name: Build tools
|
- name: Build tools
|
||||||
run: |
|
run: |
|
||||||
|
@ -430,15 +420,35 @@ jobs:
|
||||||
# If this is run on a fork, there may not be a certificate set up - continue in this case
|
# If this is run on a fork, there may not be a certificate set up - continue in this case
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Build
|
- name: Build arm64
|
||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir build-arm64
|
||||||
cd build
|
cd build-arm64
|
||||||
|
|
||||||
echo "::group::CMake"
|
echo "::group::CMake"
|
||||||
cmake ${GITHUB_WORKSPACE} \
|
cmake ${GITHUB_WORKSPACE} \
|
||||||
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.full_arch }} \
|
-DCMAKE_OSX_ARCHITECTURES=arm64 \
|
||||||
-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-osx \
|
-DVCPKG_TARGET_TRIPLET=arm64-osx \
|
||||||
|
-DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake \
|
||||||
|
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
|
||||||
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||||
|
# EOF
|
||||||
|
echo "::endgroup::"
|
||||||
|
|
||||||
|
echo "::group::Build"
|
||||||
|
echo "Running on $(sysctl -n hw.logicalcpu) cores"
|
||||||
|
make -j$(sysctl -n hw.logicalcpu)
|
||||||
|
echo "::endgroup::"
|
||||||
|
|
||||||
|
- name: Build x64
|
||||||
|
run: |
|
||||||
|
mkdir build-x64
|
||||||
|
cd build-x64
|
||||||
|
|
||||||
|
echo "::group::CMake"
|
||||||
|
cmake ${GITHUB_WORKSPACE} \
|
||||||
|
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
|
||||||
|
-DVCPKG_TARGET_TRIPLET=x64-osx \
|
||||||
-DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake \
|
-DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake \
|
||||||
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
|
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
|
||||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||||
|
@ -447,6 +457,19 @@ jobs:
|
||||||
# EOF
|
# EOF
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
||||||
|
echo "::group::Build"
|
||||||
|
echo "Running on $(sysctl -n hw.logicalcpu) cores"
|
||||||
|
make -j$(sysctl -n hw.logicalcpu)
|
||||||
|
echo "::endgroup::"
|
||||||
|
|
||||||
|
- name: Build package
|
||||||
|
run: |
|
||||||
|
cd build-x64
|
||||||
|
|
||||||
|
# Combine the `openttd` binaries from each build into a single file
|
||||||
|
lipo -create -output openttd-universal ../build-*/openttd
|
||||||
|
mv openttd-universal openttd
|
||||||
|
|
||||||
echo "::group::Build"
|
echo "::group::Build"
|
||||||
echo "Running on $(sysctl -n hw.logicalcpu) cores"
|
echo "Running on $(sysctl -n hw.logicalcpu) cores"
|
||||||
make -j$(sysctl -n hw.logicalcpu) package
|
make -j$(sysctl -n hw.logicalcpu) package
|
||||||
|
@ -469,14 +492,14 @@ jobs:
|
||||||
AC_USERNAME: ${{ secrets.APPLE_DEVELOPER_APP_USERNAME }}
|
AC_USERNAME: ${{ secrets.APPLE_DEVELOPER_APP_USERNAME }}
|
||||||
AC_PASSWORD: ${{ secrets.APPLE_DEVELOPER_APP_PASSWORD }}
|
AC_PASSWORD: ${{ secrets.APPLE_DEVELOPER_APP_PASSWORD }}
|
||||||
run: |
|
run: |
|
||||||
cd build
|
cd build-x64
|
||||||
../os/macosx/notarize.sh
|
../os/macosx/notarize.sh
|
||||||
|
|
||||||
- name: Store bundles
|
- name: Store bundles
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: openttd-macos-${{ matrix.arch }}
|
name: openttd-macos-universal
|
||||||
path: build/bundles
|
path: build-x64/bundles
|
||||||
retention-days: 5
|
retention-days: 5
|
||||||
|
|
||||||
windows:
|
windows:
|
||||||
|
|
Loading…
Reference in New Issue