Update macosx.yml #28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Compilar y Empaquetar para macOS (Intel x86_64 via Rosetta) | |
| on: | |
| push: | |
| branches: [ appimage-rebase, master, main ] | |
| workflow_dispatch: | |
| pull_request: | |
| branches: [ appimage-rebase, master, main ] | |
| jobs: | |
| build-and-package: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Clonar repositorio Trinity | |
| uses: actions/checkout@v4 | |
| with: | |
| path: 'trinity' | |
| - name: Clonar Manifiesto de mcpelauncher | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'minecraft-linux/mcpelauncher-manifest' | |
| ref: 'qt6' | |
| submodules: 'recursive' | |
| path: 'mcpelauncher' | |
| - name: Clonar mcpe-extract (Codeberg) | |
| run: git clone https://codeberg.org/javiercplus/mcpe-extract.git | |
| - name: Clonar mcpelauncher-mac-bin (Librerías puente) | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'minecraft-linux/mcpelauncher-mac-bin' | |
| path: 'mac-bin' | |
| - name: Instalar Homebrew (Intel) y dependencias | |
| run: | | |
| # Instalar Homebrew en modo x86_64 (se alojará en /usr/local) | |
| arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
| eval "$(/usr/local/bin/brew shellenv)" | |
| brew update | |
| brew install cmake ninja qt@6 libzip libpng pkg-config openssl rustup-init | |
| brew link --force qt@6 | |
| arch -x86_64 rustup-init -y | |
| - name: Compilar Trinity | |
| run: | | |
| eval "$(/usr/local/bin/brew shellenv)" | |
| cd trinity | |
| mkdir -p build && cd build | |
| arch -x86_64 cmake .. -DCMAKE_BUILD_TYPE=Release -G Ninja -DCMAKE_PREFIX_PATH="$(brew --prefix qt@6)" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=x86_64 -Wno-dev | |
| arch -x86_64 cmake --build . --parallel $(sysctl -n hw.ncpu) | |
| - name: Compilar mcpelauncher | |
| run: | | |
| eval "$(/usr/local/bin/brew shellenv)" | |
| source $HOME/.cargo/env | |
| cd mcpelauncher | |
| mkdir -p build && cd build | |
| arch -x86_64 cmake .. \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -G Ninja \ | |
| -DCMAKE_PREFIX_PATH="$(brew --prefix qt@6)" \ | |
| -DCMAKE_POLICY_DEFAULT_CMP0074=NEW \ | |
| -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ | |
| -DJNI_USE_JNIVM=ON \ | |
| -DGAMEWINDOW_SYSTEM=SDL3 \ | |
| -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \ | |
| -DCMAKE_OSX_ARCHITECTURES=x86_64 \ | |
| -Wno-dev | |
| arch -x86_64 cmake --build . --parallel $(sysctl -n hw.ncpu) | |
| - name: Compilar mcpe-extract | |
| run: | | |
| eval "$(/usr/local/bin/brew shellenv)" | |
| cd mcpe-extract | |
| mkdir -p build && cd build | |
| arch -x86_64 cmake .. \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -G Ninja \ | |
| -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ | |
| -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \ | |
| -DCMAKE_OSX_ARCHITECTURES=x86_64 \ | |
| -Wno-dev | |
| arch -x86_64 cmake --build . --parallel $(sysctl -n hw.ncpu) | |
| - name: Crear Application Bundle y Empaquetar | |
| run: | | |
| eval "$(/usr/local/bin/brew shellenv)" | |
| mkdir -p dist/Trinity.app/Contents/MacOS | |
| mkdir -p dist/Trinity.app/Contents/Resources | |
| mkdir -p dist/lib | |
| cp mcpelauncher/build/mcpelauncher-client/mcpelauncher-client dist/Trinity.app/Contents/MacOS/ | |
| cp mcpelauncher/build/mcpelauncher-webview/mcpelauncher-webview dist/Trinity.app/Contents/MacOS/ | |
| cp mcpe-extract/build/mcpelauncher-extract dist/Trinity.app/Contents/MacOS/ | |
| cp trinity/build/app/trinity dist/Trinity.app/Contents/MacOS/trinity-bin | |
| cat << 'EOF' > dist/Trinity.app/Contents/MacOS/trinity | |
| #!/bin/bash | |
| DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
| export ANGLE_DEFAULT_PLATFORM=metal | |
| export QT_MAC_WANTS_LAYER=1 | |
| exec "$DIR/trinity-bin" "$@" | |
| EOF | |
| chmod +x dist/Trinity.app/Contents/MacOS/trinity | |
| # Usar las rutas del Homebrew de Intel | |
| ln -s /usr/local/opt/qtsvg/lib/QtSvg.framework dist/lib/ | |
| ln -s /usr/local/opt/qtvirtualkeyboard/lib/QtVirtualKeyboard.framework dist/lib/ | |
| ln -s /usr/local/opt/qtvirtualkeyboard/lib/QtVirtualKeyboardQml.framework dist/lib/ | |
| cd dist | |
| arch -x86_64 $(brew --prefix qt@6)/bin/macdeployqt Trinity.app \ | |
| -executable=Trinity.app/Contents/MacOS/trinity-bin \ | |
| -executable=Trinity.app/Contents/MacOS/mcpelauncher-client \ | |
| -executable=Trinity.app/Contents/MacOS/mcpelauncher-webview \ | |
| -executable=Trinity.app/Contents/MacOS/mcpelauncher-extract | |
| cd .. | |
| # 5. Inyectar SOLO el audio de mac-bin y el ANGLE moderno en la ruta exacta | |
| mkdir -p dist/Trinity.app/Contents/MacOS/lib/native/x86_64/ | |
| # Copiamos solo las librerías de sonido (fmod), ignorando el GLES viejo | |
| cp mac-bin/lib/native/x86_64/libfmod*.dylib dist/Trinity.app/Contents/MacOS/lib/native/x86_64/ | |
| # Movemos el ANGLE fresco y moderno a la ruta donde el linker lo exige | |
| find mcpelauncher/build -name "libEGL.dylib" -exec cp {} dist/Trinity.app/Contents/MacOS/lib/native/x86_64/ \; | |
| find mcpelauncher/build -name "libGLESv2.dylib" -exec cp {} dist/Trinity.app/Contents/MacOS/lib/native/x86_64/ \; | |
| cat <<EOF > dist/Trinity.app/Contents/Info.plist | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>CFBundleExecutable</key> | |
| <string>trinity</string> | |
| <key>CFBundleIdentifier</key> | |
| <string>com.trench.trinity.launcher</string> | |
| <key>CFBundleName</key> | |
| <string>Trinity</string> | |
| <key>CFBundleIconFile</key> | |
| <string>AppIcon</string> | |
| <key>CFBundleShortVersionString</key> | |
| <string>1.0</string> | |
| <key>LSMinimumSystemVersion</key> | |
| <string>10.15</string> | |
| <key>NSHighResolutionCapable</key> | |
| <true/> | |
| </dict> | |
| </plist> | |
| EOF | |
| cp trinity/resources/branding/com.trench.trinity.launcher.icns dist/Trinity.app/Contents/Resources/AppIcon.icns | |
| cd dist | |
| arch -x86_64 codesign --force --deep --sign - Trinity.app | |
| arch -x86_64 hdiutil create -volname "Trinity Launcher" -srcfolder Trinity.app -ov -format UDZO Trinity.dmg | |
| - name: Subir instalador DMG | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: trinity-mcpelauncher-macos-dmg | |
| path: dist/Trinity.dmg | |
| if-no-files-found: error |