Skip to content

Commit ef39fc3

Browse files
committed
Unify mac os cctools build
1 parent 10dc4cd commit ef39fc3

File tree

1 file changed

+92
-147
lines changed

1 file changed

+92
-147
lines changed

.github/workflows/edopro.yml

+92-147
Original file line numberDiff line numberDiff line change
@@ -382,32 +382,57 @@ jobs:
382382
avatar_url: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
383383
username: Github
384384

385-
Mac-os:
386-
runs-on: macos-11
385+
Mac-os-cctools:
386+
strategy:
387+
fail-fast: false
388+
matrix:
389+
include:
390+
- deploy_name: osx-cctools
391+
package_name: installed_x64-osx-cctools.7z
392+
clang: x86_64-macosx
393+
compiler_arch: x86_64
394+
premake_arch: x64
395+
- deploy_name: osx-aarch64-cctools
396+
package_name: installed_aarch64-osx-cctools.7z
397+
clang: arm64-macosx
398+
compiler_arch: arm
399+
premake_arch: arm64
400+
runs-on: ubuntu-latest
387401
env:
388-
DEPLOY_BRANCH: travis-osx
389-
TRAVIS_OS_NAME: macosx
402+
DEPLOY_BRANCH: travis-osx-cctools
403+
TRAVIS_OS_NAME: linux
390404
VCPKG_ROOT: ./vcpkg2
391-
DEVELOPER_DIR: /Applications/Xcode_11.7.app/Contents/Developer
392-
MACOSX_DEPLOYMENT_TARGET: 10.11
393-
SDKROOT: /Applications/Xcode_11.7.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
394405
BUILD_CONFIG: release
395-
ARCH: x64
406+
TARGET_OS: macosx
407+
ARCH: ${{ matrix.premake_arch }}
408+
CC: ${{ format('/opt/cctools/bin/{0}-clang', matrix.clang) }}
409+
CXX: ${{ format('/opt/cctools/bin/{0}-clang++', matrix.clang) }}
410+
AR: ${{ format('/opt/cctools/bin/{0}-apple-darwin11-ar', matrix.compiler_arch) }}
411+
LDFLAGS: /opt/cctools/darwin/libclang_rt.osx.a
396412
steps:
397413
- name: Set custom env vars
398414
shell: bash
399415
run: |
400-
echo "VCPKG_CACHE_7Z_URL=$DEPENDENCIES_BASE_URL/installed_x64-osx.7z" >> $GITHUB_ENV
416+
echo "VCPKG_CACHE_7Z_URL=$DEPENDENCIES_BASE_URL/${{ matrix.package_name }}" >> $GITHUB_ENV
417+
- name: Get apt packages
418+
shell: bash
419+
run: |
420+
sudo apt update
421+
sudo apt install -y gnustep-base-runtime
401422
- uses: actions/checkout@v1
402423
with:
403424
fetch-depth: 1
425+
- name: Download cctools
426+
run: |
427+
cd /opt
428+
wget https://github.com/edo9300/cctools-build/releases/download/preview/cctools.tar.xz
429+
tar xf cctools.tar.xz
430+
cd cctools/bin
431+
ln x86_64-apple-darwin11-lipo -s lipo
432+
ln llvm-install-name-tool -s install_name_tool
404433
- name: Install premake
405434
shell: bash
406435
run: ./travis/install-premake5.sh
407-
- name: Install 10.11 SDK
408-
shell: bash
409-
run: |
410-
./travis/get-osx-sdk.sh $MACOSX_DEPLOYMENT_TARGET
411436
- name: Install dependencies
412437
shell: bash
413438
run: ./travis/dependencies.sh
@@ -423,8 +448,8 @@ jobs:
423448
run: ./travis/deploy.sh
424449
- uses: actions/upload-artifact@v3
425450
with:
426-
name: osx
427-
path: bin/x64/release/ygoprodll.app
451+
name: ${{ matrix.deploy_name }}
452+
path: ${{ format('bin/{0}/release/ygoprodll.app', matrix.premake_arch) }}
428453
- name: Log Failure
429454
uses: sarisia/actions-status-discord@v1
430455
if: failure()
@@ -439,60 +464,49 @@ jobs:
439464
avatar_url: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
440465
username: Github
441466

442-
Mac-os-cctools:
467+
Mac-os-universal-cctools:
443468
runs-on: ubuntu-latest
444469
env:
445-
DEPLOY_BRANCH: travis-osx-cctools
470+
DEPLOY_BRANCH: travis-osx-universal-cctools
446471
TRAVIS_OS_NAME: linux
447-
VCPKG_ROOT: ./vcpkg2
448-
BUILD_CONFIG: release
449472
TARGET_OS: macosx
450-
ARCH: x64
451-
CC: /opt/cctools/bin/x86_64-macosx-clang
452-
CXX: /opt/cctools/bin/x86_64-macosx-clang++
453-
AR: /opt/cctools/bin/x86_64-apple-darwin11-ar
454-
LDFLAGS: /opt/cctools/darwin/libclang_rt.osx.a
473+
needs: [ Mac-os-cctools ]
455474
steps:
456-
- name: Set custom env vars
457-
shell: bash
458-
run: |
459-
echo "VCPKG_CACHE_7Z_URL=$DEPENDENCIES_BASE_URL/installed_x64-osx-cctools.7z" >> $GITHUB_ENV
475+
- uses: actions/checkout@v1
476+
with:
477+
fetch-depth: 1
460478
- name: Get apt packages
461479
shell: bash
462480
run: |
463481
sudo apt update
464482
sudo apt install -y gnustep-base-runtime
465-
- uses: actions/checkout@v1
466-
with:
467-
fetch-depth: 1
468-
- name: Download cctools
483+
- name: Download lipo binary
469484
run: |
470-
cd /opt
471-
wget https://github.com/edo9300/cctools-build/releases/download/preview/cctools.tar.xz
472-
tar xf cctools.tar.xz
473-
cd cctools/bin
474-
ln x86_64-apple-darwin11-lipo -s lipo
475-
ln llvm-install-name-tool -s install_name_tool
476-
- name: Install premake
477-
shell: bash
478-
run: ./travis/install-premake5.sh
479-
- name: Install dependencies
485+
wget https://github.com/edo9300/cctools-build/releases/download/preview/lipo
486+
chmod +x lipo
487+
- name: Download osx artifacts
488+
uses: actions/download-artifact@v3
489+
- name: Merge binaries
480490
shell: bash
481-
run: ./travis/dependencies.sh
482-
- name: Build
491+
run: |
492+
./lipo -create -output ygoprodll ./osx-aarch64-cctools/ygoprodll.app ./osx-cctools/ygoprodll.app
493+
- name: Move merged binary
483494
shell: bash
484-
run: ./travis/build.sh
495+
run: |
496+
mkdir -p bin/release && cp ygoprodll bin/release/ygoprodll.app && chmod +x bin/release/ygoprodll.app
485497
- name: Predeploy
486498
shell: bash
487499
run: ./travis/predeploy.sh
488500
- name: Deploy
489501
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
490502
shell: bash
491503
run: ./travis/deploy.sh
492-
- uses: actions/upload-artifact@v3
504+
- name: Delete artifacts
505+
uses: geekyeggo/delete-artifact@v2
493506
with:
494-
name: osx-cctools
495-
path: bin/x64/release/ygoprodll.app
507+
name: |
508+
osx-aarch64-cctools
509+
osx-cctools
496510
- name: Log Failure
497511
uses: sarisia/actions-status-discord@v1
498512
if: failure()
@@ -507,36 +521,36 @@ jobs:
507521
avatar_url: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
508522
username: Github
509523

510-
Mac-os-aarch64:
511-
runs-on: macos-latest
524+
Mac-os:
525+
runs-on: macos-11
512526
env:
513-
DEPLOY_BRANCH: travis-osx-aarch64
527+
DEPLOY_BRANCH: travis-osx
514528
TRAVIS_OS_NAME: macosx
515529
VCPKG_ROOT: ./vcpkg2
516-
MACOSX_DEPLOYMENT_TARGET: 11.0
517-
SDKROOT: /Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
530+
DEVELOPER_DIR: /Applications/Xcode_11.7.app/Contents/Developer
531+
MACOSX_DEPLOYMENT_TARGET: 10.11
532+
SDKROOT: /Applications/Xcode_11.7.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
518533
BUILD_CONFIG: release
519-
ARCH: arm64
534+
ARCH: x64
520535
steps:
521536
- name: Set custom env vars
522537
shell: bash
523538
run: |
524-
echo "VCPKG_CACHE_7Z_URL=$DEPENDENCIES_BASE_URL/installed_aarch64-osx.7z" >> $GITHUB_ENV
539+
echo "VCPKG_CACHE_7Z_URL=$DEPENDENCIES_BASE_URL/installed_x64-osx.7z" >> $GITHUB_ENV
525540
- uses: actions/checkout@v1
526541
with:
527542
fetch-depth: 1
528543
- name: Install premake
529544
shell: bash
530545
run: ./travis/install-premake5.sh
531-
- name: Install dependencies
546+
- name: Install 10.11 SDK
532547
shell: bash
533548
run: |
534-
./travis/dependencies.sh
549+
./travis/get-osx-sdk.sh $MACOSX_DEPLOYMENT_TARGET
550+
- name: Install dependencies
551+
shell: bash
552+
run: ./travis/dependencies.sh
535553
- name: Build
536-
env:
537-
CXXFLAGS: -target arm64-apple-macos11
538-
CFLAGS: -target arm64-apple-macos11
539-
LDFLAGS: -target arm64-apple-macos11
540554
shell: bash
541555
run: ./travis/build.sh
542556
- name: Predeploy
@@ -548,8 +562,8 @@ jobs:
548562
run: ./travis/deploy.sh
549563
- uses: actions/upload-artifact@v3
550564
with:
551-
name: osx-aarch64
552-
path: bin/arm64/release/ygoprodll.app
565+
name: osx
566+
path: bin/x64/release/ygoprodll.app
553567
- name: Log Failure
554568
uses: sarisia/actions-status-discord@v1
555569
if: failure()
@@ -564,47 +578,36 @@ jobs:
564578
avatar_url: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
565579
username: Github
566580

567-
Mac-os-aarch64-cctools:
568-
runs-on: ubuntu-latest
581+
Mac-os-aarch64:
582+
runs-on: macos-latest
569583
env:
570-
DEPLOY_BRANCH: travis-osx-aarch64-cctools
571-
TRAVIS_OS_NAME: linux
584+
DEPLOY_BRANCH: travis-osx-aarch64
585+
TRAVIS_OS_NAME: macosx
572586
VCPKG_ROOT: ./vcpkg2
587+
MACOSX_DEPLOYMENT_TARGET: 11.0
588+
SDKROOT: /Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
573589
BUILD_CONFIG: release
574-
TARGET_OS: macosx
575590
ARCH: arm64
576-
CC: /opt/cctools/bin/arm64-macosx-clang
577-
CXX: /opt/cctools/bin/arm64-macosx-clang++
578-
AR: /opt/cctools/bin/arm-apple-darwin11-ar
579-
LDFLAGS: /opt/cctools/darwin/libclang_rt.osx.a
580591
steps:
581592
- name: Set custom env vars
582593
shell: bash
583594
run: |
584-
echo "VCPKG_CACHE_7Z_URL=$DEPENDENCIES_BASE_URL/installed_aarch64-osx-cctools.7z" >> $GITHUB_ENV
585-
- name: Get apt packages
586-
shell: bash
587-
run: |
588-
sudo apt update
589-
sudo apt install -y gnustep-base-runtime
595+
echo "VCPKG_CACHE_7Z_URL=$DEPENDENCIES_BASE_URL/installed_aarch64-osx.7z" >> $GITHUB_ENV
590596
- uses: actions/checkout@v1
591597
with:
592598
fetch-depth: 1
593-
- name: Download cctools
594-
run: |
595-
cd /opt
596-
wget https://github.com/edo9300/cctools-build/releases/download/preview/cctools.tar.xz
597-
tar xf cctools.tar.xz
598-
cd cctools/bin
599-
ln x86_64-apple-darwin11-lipo -s lipo
600-
ln llvm-install-name-tool -s install_name_tool
601599
- name: Install premake
602600
shell: bash
603601
run: ./travis/install-premake5.sh
604602
- name: Install dependencies
605603
shell: bash
606-
run: ./travis/dependencies.sh
604+
run: |
605+
./travis/dependencies.sh
607606
- name: Build
607+
env:
608+
CXXFLAGS: -target arm64-apple-macos11
609+
CFLAGS: -target arm64-apple-macos11
610+
LDFLAGS: -target arm64-apple-macos11
608611
shell: bash
609612
run: ./travis/build.sh
610613
- name: Predeploy
@@ -616,7 +619,7 @@ jobs:
616619
run: ./travis/deploy.sh
617620
- uses: actions/upload-artifact@v3
618621
with:
619-
name: osx-aarch64-cctools
622+
name: osx-aarch64
620623
path: bin/arm64/release/ygoprodll.app
621624
- name: Log Failure
622625
uses: sarisia/actions-status-discord@v1
@@ -679,63 +682,6 @@ jobs:
679682
avatar_url: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
680683
username: Github
681684

682-
Mac-os-universal-cctools:
683-
runs-on: ubuntu-latest
684-
env:
685-
DEPLOY_BRANCH: travis-osx-universal-cctools
686-
TRAVIS_OS_NAME: linux
687-
TARGET_OS: macosx
688-
needs: [ Mac-os-cctools, Mac-os-aarch64-cctools ]
689-
steps:
690-
- uses: actions/checkout@v1
691-
with:
692-
fetch-depth: 1
693-
- name: Get apt packages
694-
shell: bash
695-
run: |
696-
sudo apt update
697-
sudo apt install -y gnustep-base-runtime
698-
- name: Download lipo binary
699-
run: |
700-
wget https://github.com/edo9300/cctools-build/releases/download/preview/lipo
701-
chmod +x lipo
702-
- name: Download osx artifacts
703-
uses: actions/download-artifact@v3
704-
- name: Merge binaries
705-
shell: bash
706-
run: |
707-
./lipo -create -output ygoprodll ./osx-aarch64-cctools/ygoprodll.app ./osx-cctools/ygoprodll.app
708-
- name: Move merged binary
709-
shell: bash
710-
run: |
711-
mkdir -p bin/release && cp ygoprodll bin/release/ygoprodll.app && chmod +x bin/release/ygoprodll.app
712-
- name: Predeploy
713-
shell: bash
714-
run: ./travis/predeploy.sh
715-
- name: Deploy
716-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
717-
shell: bash
718-
run: ./travis/deploy.sh
719-
- name: Delete artifacts
720-
uses: geekyeggo/delete-artifact@v2
721-
with:
722-
name: |
723-
osx-aarch64-cctools
724-
osx-cctools
725-
- name: Log Failure
726-
uses: sarisia/actions-status-discord@v1
727-
if: failure()
728-
with:
729-
nodetail: true
730-
description: |
731-
[[${{ github.event.repository.name }}] ${{ github.job }} failed on ${{ github.ref }}](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}})
732-
title: |
733-
734-
color: 0xff0000
735-
webhook: ${{ secrets.DISCORD_WEBHOOK }}
736-
avatar_url: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
737-
username: Github
738-
739685
Ios-cctools:
740686
strategy:
741687
fail-fast: false
@@ -775,13 +721,12 @@ jobs:
775721
CXX: ${{ format('/opt/cctools/bin/{0}-clang++', matrix.clang) }}
776722
AR: ${{ format('/opt/cctools/bin/{0}-apple-darwin11-ar', matrix.compiler_arch) }}
777723
RANLIB: ${{ format('/opt/cctools/bin/{0}-apple-darwin11-ranlib', matrix.compiler_arch) }}
778-
ARCHIVE_NAME: ${{ matrix.package_name }}
779724
LDFLAGS: ${{ format('/opt/cctools/darwin/{0}', matrix.libclang_rt) }}
780725
steps:
781726
- name: Set custom env vars
782727
shell: bash
783728
run: |
784-
echo "VCPKG_CACHE_7Z_URL=$DEPENDENCIES_BASE_URL/$ARCHIVE_NAME" >> $GITHUB_ENV
729+
echo "VCPKG_CACHE_7Z_URL=$DEPENDENCIES_BASE_URL/${{ matrix.package_name }}" >> $GITHUB_ENV
785730
- name: Get apt packages
786731
shell: bash
787732
run: |

0 commit comments

Comments
 (0)