Skip to content

Commit

Permalink
Unify mac os cctools build
Browse files Browse the repository at this point in the history
  • Loading branch information
edo9300 committed Jun 4, 2023
1 parent 10dc4cd commit ef39fc3
Showing 1 changed file with 92 additions and 147 deletions.
239 changes: 92 additions & 147 deletions .github/workflows/edopro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -382,32 +382,57 @@ jobs:
avatar_url: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
username: Github

Mac-os:
runs-on: macos-11
Mac-os-cctools:
strategy:
fail-fast: false
matrix:
include:
- deploy_name: osx-cctools
package_name: installed_x64-osx-cctools.7z
clang: x86_64-macosx
compiler_arch: x86_64
premake_arch: x64
- deploy_name: osx-aarch64-cctools
package_name: installed_aarch64-osx-cctools.7z
clang: arm64-macosx
compiler_arch: arm
premake_arch: arm64
runs-on: ubuntu-latest
env:
DEPLOY_BRANCH: travis-osx
TRAVIS_OS_NAME: macosx
DEPLOY_BRANCH: travis-osx-cctools
TRAVIS_OS_NAME: linux
VCPKG_ROOT: ./vcpkg2
DEVELOPER_DIR: /Applications/Xcode_11.7.app/Contents/Developer
MACOSX_DEPLOYMENT_TARGET: 10.11
SDKROOT: /Applications/Xcode_11.7.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
BUILD_CONFIG: release
ARCH: x64
TARGET_OS: macosx
ARCH: ${{ matrix.premake_arch }}
CC: ${{ format('/opt/cctools/bin/{0}-clang', matrix.clang) }}
CXX: ${{ format('/opt/cctools/bin/{0}-clang++', matrix.clang) }}
AR: ${{ format('/opt/cctools/bin/{0}-apple-darwin11-ar', matrix.compiler_arch) }}
LDFLAGS: /opt/cctools/darwin/libclang_rt.osx.a
steps:
- name: Set custom env vars
shell: bash
run: |
echo "VCPKG_CACHE_7Z_URL=$DEPENDENCIES_BASE_URL/installed_x64-osx.7z" >> $GITHUB_ENV
echo "VCPKG_CACHE_7Z_URL=$DEPENDENCIES_BASE_URL/${{ matrix.package_name }}" >> $GITHUB_ENV
- name: Get apt packages
shell: bash
run: |
sudo apt update
sudo apt install -y gnustep-base-runtime
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Download cctools
run: |
cd /opt
wget https://github.com/edo9300/cctools-build/releases/download/preview/cctools.tar.xz
tar xf cctools.tar.xz
cd cctools/bin
ln x86_64-apple-darwin11-lipo -s lipo
ln llvm-install-name-tool -s install_name_tool
- name: Install premake
shell: bash
run: ./travis/install-premake5.sh
- name: Install 10.11 SDK
shell: bash
run: |
./travis/get-osx-sdk.sh $MACOSX_DEPLOYMENT_TARGET
- name: Install dependencies
shell: bash
run: ./travis/dependencies.sh
Expand All @@ -423,8 +448,8 @@ jobs:
run: ./travis/deploy.sh
- uses: actions/upload-artifact@v3
with:
name: osx
path: bin/x64/release/ygoprodll.app
name: ${{ matrix.deploy_name }}
path: ${{ format('bin/{0}/release/ygoprodll.app', matrix.premake_arch) }}
- name: Log Failure
uses: sarisia/actions-status-discord@v1
if: failure()
Expand All @@ -439,60 +464,49 @@ jobs:
avatar_url: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
username: Github

Mac-os-cctools:
Mac-os-universal-cctools:
runs-on: ubuntu-latest
env:
DEPLOY_BRANCH: travis-osx-cctools
DEPLOY_BRANCH: travis-osx-universal-cctools
TRAVIS_OS_NAME: linux
VCPKG_ROOT: ./vcpkg2
BUILD_CONFIG: release
TARGET_OS: macosx
ARCH: x64
CC: /opt/cctools/bin/x86_64-macosx-clang
CXX: /opt/cctools/bin/x86_64-macosx-clang++
AR: /opt/cctools/bin/x86_64-apple-darwin11-ar
LDFLAGS: /opt/cctools/darwin/libclang_rt.osx.a
needs: [ Mac-os-cctools ]
steps:
- name: Set custom env vars
shell: bash
run: |
echo "VCPKG_CACHE_7Z_URL=$DEPENDENCIES_BASE_URL/installed_x64-osx-cctools.7z" >> $GITHUB_ENV
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Get apt packages
shell: bash
run: |
sudo apt update
sudo apt install -y gnustep-base-runtime
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Download cctools
- name: Download lipo binary
run: |
cd /opt
wget https://github.com/edo9300/cctools-build/releases/download/preview/cctools.tar.xz
tar xf cctools.tar.xz
cd cctools/bin
ln x86_64-apple-darwin11-lipo -s lipo
ln llvm-install-name-tool -s install_name_tool
- name: Install premake
shell: bash
run: ./travis/install-premake5.sh
- name: Install dependencies
wget https://github.com/edo9300/cctools-build/releases/download/preview/lipo
chmod +x lipo
- name: Download osx artifacts
uses: actions/download-artifact@v3
- name: Merge binaries
shell: bash
run: ./travis/dependencies.sh
- name: Build
run: |
./lipo -create -output ygoprodll ./osx-aarch64-cctools/ygoprodll.app ./osx-cctools/ygoprodll.app
- name: Move merged binary
shell: bash
run: ./travis/build.sh
run: |
mkdir -p bin/release && cp ygoprodll bin/release/ygoprodll.app && chmod +x bin/release/ygoprodll.app
- name: Predeploy
shell: bash
run: ./travis/predeploy.sh
- name: Deploy
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
shell: bash
run: ./travis/deploy.sh
- uses: actions/upload-artifact@v3
- name: Delete artifacts
uses: geekyeggo/delete-artifact@v2
with:
name: osx-cctools
path: bin/x64/release/ygoprodll.app
name: |
osx-aarch64-cctools
osx-cctools
- name: Log Failure
uses: sarisia/actions-status-discord@v1
if: failure()
Expand All @@ -507,36 +521,36 @@ jobs:
avatar_url: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
username: Github

Mac-os-aarch64:
runs-on: macos-latest
Mac-os:
runs-on: macos-11
env:
DEPLOY_BRANCH: travis-osx-aarch64
DEPLOY_BRANCH: travis-osx
TRAVIS_OS_NAME: macosx
VCPKG_ROOT: ./vcpkg2
MACOSX_DEPLOYMENT_TARGET: 11.0
SDKROOT: /Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
DEVELOPER_DIR: /Applications/Xcode_11.7.app/Contents/Developer
MACOSX_DEPLOYMENT_TARGET: 10.11
SDKROOT: /Applications/Xcode_11.7.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
BUILD_CONFIG: release
ARCH: arm64
ARCH: x64
steps:
- name: Set custom env vars
shell: bash
run: |
echo "VCPKG_CACHE_7Z_URL=$DEPENDENCIES_BASE_URL/installed_aarch64-osx.7z" >> $GITHUB_ENV
echo "VCPKG_CACHE_7Z_URL=$DEPENDENCIES_BASE_URL/installed_x64-osx.7z" >> $GITHUB_ENV
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Install premake
shell: bash
run: ./travis/install-premake5.sh
- name: Install dependencies
- name: Install 10.11 SDK
shell: bash
run: |
./travis/dependencies.sh
./travis/get-osx-sdk.sh $MACOSX_DEPLOYMENT_TARGET
- name: Install dependencies
shell: bash
run: ./travis/dependencies.sh
- name: Build
env:
CXXFLAGS: -target arm64-apple-macos11
CFLAGS: -target arm64-apple-macos11
LDFLAGS: -target arm64-apple-macos11
shell: bash
run: ./travis/build.sh
- name: Predeploy
Expand All @@ -548,8 +562,8 @@ jobs:
run: ./travis/deploy.sh
- uses: actions/upload-artifact@v3
with:
name: osx-aarch64
path: bin/arm64/release/ygoprodll.app
name: osx
path: bin/x64/release/ygoprodll.app
- name: Log Failure
uses: sarisia/actions-status-discord@v1
if: failure()
Expand All @@ -564,47 +578,36 @@ jobs:
avatar_url: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
username: Github

Mac-os-aarch64-cctools:
runs-on: ubuntu-latest
Mac-os-aarch64:
runs-on: macos-latest
env:
DEPLOY_BRANCH: travis-osx-aarch64-cctools
TRAVIS_OS_NAME: linux
DEPLOY_BRANCH: travis-osx-aarch64
TRAVIS_OS_NAME: macosx
VCPKG_ROOT: ./vcpkg2
MACOSX_DEPLOYMENT_TARGET: 11.0
SDKROOT: /Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
BUILD_CONFIG: release
TARGET_OS: macosx
ARCH: arm64
CC: /opt/cctools/bin/arm64-macosx-clang
CXX: /opt/cctools/bin/arm64-macosx-clang++
AR: /opt/cctools/bin/arm-apple-darwin11-ar
LDFLAGS: /opt/cctools/darwin/libclang_rt.osx.a
steps:
- name: Set custom env vars
shell: bash
run: |
echo "VCPKG_CACHE_7Z_URL=$DEPENDENCIES_BASE_URL/installed_aarch64-osx-cctools.7z" >> $GITHUB_ENV
- name: Get apt packages
shell: bash
run: |
sudo apt update
sudo apt install -y gnustep-base-runtime
echo "VCPKG_CACHE_7Z_URL=$DEPENDENCIES_BASE_URL/installed_aarch64-osx.7z" >> $GITHUB_ENV
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Download cctools
run: |
cd /opt
wget https://github.com/edo9300/cctools-build/releases/download/preview/cctools.tar.xz
tar xf cctools.tar.xz
cd cctools/bin
ln x86_64-apple-darwin11-lipo -s lipo
ln llvm-install-name-tool -s install_name_tool
- name: Install premake
shell: bash
run: ./travis/install-premake5.sh
- name: Install dependencies
shell: bash
run: ./travis/dependencies.sh
run: |
./travis/dependencies.sh
- name: Build
env:
CXXFLAGS: -target arm64-apple-macos11
CFLAGS: -target arm64-apple-macos11
LDFLAGS: -target arm64-apple-macos11
shell: bash
run: ./travis/build.sh
- name: Predeploy
Expand All @@ -616,7 +619,7 @@ jobs:
run: ./travis/deploy.sh
- uses: actions/upload-artifact@v3
with:
name: osx-aarch64-cctools
name: osx-aarch64
path: bin/arm64/release/ygoprodll.app
- name: Log Failure
uses: sarisia/actions-status-discord@v1
Expand Down Expand Up @@ -679,63 +682,6 @@ jobs:
avatar_url: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
username: Github

Mac-os-universal-cctools:
runs-on: ubuntu-latest
env:
DEPLOY_BRANCH: travis-osx-universal-cctools
TRAVIS_OS_NAME: linux
TARGET_OS: macosx
needs: [ Mac-os-cctools, Mac-os-aarch64-cctools ]
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Get apt packages
shell: bash
run: |
sudo apt update
sudo apt install -y gnustep-base-runtime
- name: Download lipo binary
run: |
wget https://github.com/edo9300/cctools-build/releases/download/preview/lipo
chmod +x lipo
- name: Download osx artifacts
uses: actions/download-artifact@v3
- name: Merge binaries
shell: bash
run: |
./lipo -create -output ygoprodll ./osx-aarch64-cctools/ygoprodll.app ./osx-cctools/ygoprodll.app
- name: Move merged binary
shell: bash
run: |
mkdir -p bin/release && cp ygoprodll bin/release/ygoprodll.app && chmod +x bin/release/ygoprodll.app
- name: Predeploy
shell: bash
run: ./travis/predeploy.sh
- name: Deploy
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
shell: bash
run: ./travis/deploy.sh
- name: Delete artifacts
uses: geekyeggo/delete-artifact@v2
with:
name: |
osx-aarch64-cctools
osx-cctools
- name: Log Failure
uses: sarisia/actions-status-discord@v1
if: failure()
with:
nodetail: true
description: |
[[${{ github.event.repository.name }}] ${{ github.job }} failed on ${{ github.ref }}](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}})
title: |
color: 0xff0000
webhook: ${{ secrets.DISCORD_WEBHOOK }}
avatar_url: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
username: Github

Ios-cctools:
strategy:
fail-fast: false
Expand Down Expand Up @@ -775,13 +721,12 @@ jobs:
CXX: ${{ format('/opt/cctools/bin/{0}-clang++', matrix.clang) }}
AR: ${{ format('/opt/cctools/bin/{0}-apple-darwin11-ar', matrix.compiler_arch) }}
RANLIB: ${{ format('/opt/cctools/bin/{0}-apple-darwin11-ranlib', matrix.compiler_arch) }}
ARCHIVE_NAME: ${{ matrix.package_name }}
LDFLAGS: ${{ format('/opt/cctools/darwin/{0}', matrix.libclang_rt) }}
steps:
- name: Set custom env vars
shell: bash
run: |
echo "VCPKG_CACHE_7Z_URL=$DEPENDENCIES_BASE_URL/$ARCHIVE_NAME" >> $GITHUB_ENV
echo "VCPKG_CACHE_7Z_URL=$DEPENDENCIES_BASE_URL/${{ matrix.package_name }}" >> $GITHUB_ENV
- name: Get apt packages
shell: bash
run: |
Expand Down

0 comments on commit ef39fc3

Please sign in to comment.