X86-64 simple Compilar y Empaquetar AppImage #58
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: X86-64 simple Compilar y Empaquetar AppImage | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build-and-package: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clonar repositorio Trinity | |
| uses: actions/checkout@v4 | |
| with: | |
| path: 'trinity' | |
| - name: Clonar mcpe-nx | |
| run: | | |
| git clone ${{ secrets.MCPE_NX }} mcpe-nx > /dev/null 2>&1 | |
| - name: Clonar tapk-extract | |
| run: git clone https://gitlab.com/javiercplus/tapk-extract.git | |
| - name: Clonar mcpelauncher-linux-bin | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'minecraft-linux/mcpelauncher-linux-bin' | |
| path: 'linux-bin' | |
| - name: Instalar dependencias del sistema | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| ca-certificates build-essential git curl cmake clang ninja-build \ | |
| qt6-base-dev qt6-base-dev-tools qt6-declarative-dev qt6-webengine-dev qt6-svg-dev qt6-tools-dev \ | |
| libcurl4-openssl-dev libssl-dev libasound2-dev libpulse-dev libjack-jackd2-dev \ | |
| libpipewire-0.3-dev libsndio-dev libx11-dev libxi-dev libxext-dev libxfixes-dev \ | |
| libxcursor-dev libxrandr-dev libxss-dev libxtst-dev libgl1-mesa-dev libegl1-mesa-dev \ | |
| libgles2-mesa-dev libvulkan-dev vulkan-validationlayers libdrm-dev libgbm-dev \ | |
| libudev-dev libevdev-dev libusb-1.0-0-dev libdbus-1-dev libbluetooth-dev bluez \ | |
| libibus-1.0-dev libxkbcommon-dev libpng-dev libzip-dev libcups2-dev \ | |
| libwayland-dev libunwind-dev libdecor-0-dev libfuse2 wget file python3 zsync \ | |
| pciutils pci.ids | |
| - name: Compilar mcpelauncher (Modo sin GUI) | |
| run: | | |
| export CC=clang | |
| export CXX=clang++ | |
| cd mcpe-nx | |
| mkdir -p build && cd build | |
| cmake .. \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -G Ninja \ | |
| -DBUILD_WEBVIEW=OFF \ | |
| -DGAMEWINDOW_SYSTEM=SDL3 \ | |
| -DBUILD_UI=OFF \ | |
| -Wno-dev | |
| ninja -v | |
| - name: Compilar tapk-extract (Zig) | |
| run: | | |
| wget -q https://ziglang.org/download/0.16.0/zig-x86_64-linux-0.16.0.tar.xz | |
| tar -xf zig-x86_64-linux-0.16.0.tar.xz | |
| export PATH="$PWD/zig-x86_64-linux-0.16.0:$PATH" | |
| cd tapk-extract | |
| zig build --release=fast | |
| ls -la zig-out/bin/ | |
| - name: Compilar Trinity Launcher | |
| run: | | |
| cd trinity | |
| chmod +x build.sh | |
| ./build.sh --deps | |
| ./build.sh --release | |
| - name: Preparar estructura AppDir | |
| run: | | |
| mkdir -p APPIMAGE-TRINITY/usr/bin | |
| mkdir -p APPIMAGE-TRINITY/usr/lib | |
| mkdir -p APPIMAGE-TRINITY/usr/lib32 | |
| mkdir -p APPIMAGE-TRINITY/usr/share/applications | |
| mkdir -p APPIMAGE-TRINITY/usr/share/icons/hicolor/scalable/apps | |
| mkdir -p APPIMAGE-TRINITY/usr/share/metainfo | |
| mkdir -p APPIMAGE-TRINITY/usr/share/mcpelauncher | |
| # Descargamos y extraemos, pero AÚN NO lo copiamos al AppDir | |
| wget https://huggingface.co/datasets/ccoffee20/PEPE/resolve/main/mcpe32bit.tar | |
| tar -xf mcpe32bit.tar | |
| cp mcpe-nx/build/mcpelauncher-client/mcpelauncher-client APPIMAGE-TRINITY/usr/bin/ | |
| cp tapk-extract/zig-out/bin/tapk-extract APPIMAGE-TRINITY/usr/bin/mcpelauncher-extract | |
| cp trinity/build/app/trinity APPIMAGE-TRINITY/usr/bin/ | |
| find mcpe-nx/build -type f -name "msa-daemon" -exec cp {} APPIMAGE-TRINITY/usr/bin/ \; | |
| find mcpe-nx/build -type f -name "mcpelauncher-error" -exec cp {} APPIMAGE-TRINITY/usr/bin/ \; | |
| cp trinity/resources/shortcuts/com.trench.trinity.launcher.desktop APPIMAGE-TRINITY/usr/share/applications/ | |
| cp trinity/resources/branding/com.trench.trinity.launcher.svg APPIMAGE-TRINITY/usr/share/icons/hicolor/scalable/apps/ | |
| cp -r linux-bin/* APPIMAGE-TRINITY/usr/share/mcpelauncher/ | |
| - name: Integrar Librería libzip (Portabilidad Total) | |
| run: | | |
| LIBZIP_REAL=$(find /usr/lib/x86_64-linux-gnu -name "libzip.so*" -type f | head -n 1) | |
| cp -v "$LIBZIP_REAL" APPIMAGE-TRINITY/usr/lib/libzip.so.5 | |
| chmod +w APPIMAGE-TRINITY/usr/lib/libzip.so.5 | |
| - name: Integrar lspci (detección de GPU) | |
| run: | | |
| # Empaqueta lspci + pcilib para la detección de GPUs en el gestor de contenido | |
| mkdir -p APPIMAGE-TRINITY/usr/share/hwdata | |
| cp -v /usr/bin/lspci APPIMAGE-TRINITY/usr/bin/ | |
| cp -v /usr/bin/setpci APPIMAGE-TRINITY/usr/bin/ 2>/dev/null || true | |
| find /usr/lib/x86_64-linux-gnu -name "libpci.so*" -exec cp -v -P {} APPIMAGE-TRINITY/usr/lib/ \; 2>/dev/null || true | |
| cp -v /usr/lib/x86_64-linux-gnu/libzstd.so.* APPIMAGE-TRINITY/usr/lib/ 2>/dev/null || true | |
| cp -v /usr/lib/x86_64-linux-gnu/libz.so.* APPIMAGE-TRINITY/usr/lib/ 2>/dev/null || true | |
| cp -v /usr/share/misc/pci.ids APPIMAGE-TRINITY/usr/share/hwdata/ 2>/dev/null || true | |
| - name: Crear script AppRun y enlaces en raíz | |
| run: | | |
| cat << 'EOF' > APPIMAGE-TRINITY/AppRun | |
| #!/bin/sh | |
| HERE="$(dirname "$(readlink -f "$0")")" | |
| export LD_LIBRARY_PATH="$HERE/usr/lib:$LD_LIBRARY_PATH" | |
| export QT_QPA_PLATFORM="xcb" | |
| export GDK_BACKEND="x11" | |
| export DISABLE_WAYLAND=1 | |
| export MCPELAUNCHER_DATA_DIR="$HERE/usr/share/mcpelauncher" | |
| export PCI_IDS="$HERE/usr/share/hwdata/pci.ids" | |
| export PATH="$HERE/usr/bin:$PATH" | |
| exec "$HERE/usr/bin/trinity" "$@" | |
| EOF | |
| chmod +x APPIMAGE-TRINITY/AppRun | |
| ln -s usr/share/applications/com.trench.trinity.launcher.desktop APPIMAGE-TRINITY/com.trench.trinity.launcher.desktop | |
| ln -s usr/share/icons/hicolor/scalable/apps/com.trench.trinity.launcher.svg APPIMAGE-TRINITY/com.trench.trinity.launcher.svg | |
| - name: Descargar linuxdeploy y plugin Qt | |
| run: | | |
| wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage | |
| wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage | |
| chmod +x linuxdeploy*.AppImage | |
| - name: Ejecutar empaquetado y generar zsync | |
| run: | | |
| export QMAKE=/usr/lib/qt6/bin/qmake | |
| export LD_LIBRARY_PATH=$PWD/APPIMAGE-TRINITY/usr/lib:/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH | |
| # 1. Ejecutar linuxdeploy SOLO para preparar dependencias (sin --output appimage) | |
| ./linuxdeploy-x86_64.AppImage \ | |
| --appdir APPIMAGE-TRINITY \ | |
| -e APPIMAGE-TRINITY/usr/bin/trinity \ | |
| --desktop-file APPIMAGE-TRINITY/usr/share/applications/com.trench.trinity.launcher.desktop \ | |
| --icon-file APPIMAGE-TRINITY/usr/share/icons/hicolor/scalable/apps/com.trench.trinity.launcher.svg \ | |
| --plugin qt | |
| # 2. AHORA copiamos el binario de 32 bits al AppDir (así linuxdeploy no lo escanea) | |
| cp 32bitmcpe/bin/mcpelauncher-client86 APPIMAGE-TRINITY/usr/bin/ | |
| cp -ar 32bitmcpe/lib32/* APPIMAGE-TRINITY/usr/lib32/ | |
| chmod +x APPIMAGE-TRINITY/usr/bin/mcpelauncher-client86 | |
| # Limpiar librerías gráficas conflictivas de 32 bits | |
| rm -rf APPIMAGE-TRINITY/usr/lib32/libGLdispatch.so* | |
| rm -rf APPIMAGE-TRINITY/usr/lib32/libX*.so* | |
| rm -rf APPIMAGE-TRINITY/usr/lib32/libxcb*.so* | |
| # 3. Empaquetar usando appimagetool directamente | |
| wget -q https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage | |
| chmod +x appimagetool-x86_64.AppImage | |
| export APPIMAGE_EXTRACT_AND_RUN=1 | |
| export UPDATE_INFORMATION="gh-releases-zsync|${GITHUB_REPOSITORY%/*}|${GITHUB_REPOSITORY#*/}-x86_64.AppImage.zsync" | |
| ARCH=x86_64 ./appimagetool-x86_64.AppImage APPIMAGE-TRINITY Trinity_Launcher-x86_64.AppImage | |
| - name: Subir a Release (nightly) | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: latest | |
| files: | | |
| Trinity_Launcher-x86_64.AppImage | |
| *.zsync |