Construir y Firmar Trinity Flatpak #34
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: Construir y Firmar Trinity Flatpak | |
| on: | |
| workflow_dispatch: | |
| workflow_call: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-sign: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 1. Clonar Repositorio Trinity Launcher | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'Trinity-LA/Trinity-Launcher' | |
| ref: 'flatpak-build' | |
| - name: 2. Instalar Flatpak y Dependencias del SDK | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y flatpak flatpak-builder | |
| # Añadir repositorio Flathub para descargar el SDK | |
| flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo | |
| # Instalar Platform y SDK de KDE 6.10 (Requerido por tu JSON) | |
| flatpak install --user -y flathub org.kde.Platform//6.10 org.kde.Sdk//6.10 org.freedesktop.Sdk.Extension.llvm21 io.qt.qtwebengine.BaseApp/x86_64/6.10 | |
| - name: 3. Descargar y Extraer Binarios | |
| run: | | |
| echo "Descargando binarios precompilados..." | |
| wget -qO binarios.tar https://huggingface.co/datasets/ccoffee20/trinity-installer/resolve/main/binarios.tar | |
| echo "Extrayendo en files/bin/..." | |
| mkdir -p files/bin/ | |
| tar -xf binarios.tar -C files/bin/ | |
| # Descarga, extracción y ubicación del entorno de 32 bits | |
| wget https://huggingface.co/datasets/ccoffee20/PEPE/resolve/main/mcpe32bit.tar | |
| tar -xf mcpe32bit.tar | |
| cp 32bitmcpe/bin/mcpelauncher-client86 files/bin/ | |
| chmod +x files/bin/mcpelauncher-client86 | |
| mkdir -p files/lib32 | |
| cp -a 32bitmcpe/lib32/* files/lib32/ | |
| rm -f files/lib32/libGLdispatch.so* | |
| rm -rf files/lib32/libX*.so* | |
| rm -rf files/lib32/libxcb*.so* | |
| - name: 4. Importar Clave Privada GPG | |
| env: | |
| GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
| run: | | |
| # Importar la clave privada silenciosamente | |
| echo "$GPG_PRIVATE_KEY" | gpg --batch --import | |
| - name: 5. Construir y Firmar Repositorio Flatpak | |
| run: | | |
| # Construimos, exportamos al directorio 'repo' y firmamos en un solo paso | |
| flatpak-builder \ | |
| --user \ | |
| --force-clean \ | |
| --repo=repo \ | |
| --gpg-sign=3836B4996BE036C47837B97122C763D7166AAEB9 \ | |
| build-dir \ | |
| com.trench.trinity.launcher.json | |
| # Actualizamos los metadatos del repositorio final con la firma | |
| flatpak build-update-repo --gpg-sign=3836B4996BE036C47837B97122C763D7166AAEB9 repo/ | |
| - name: 6. Generar Bundle Instalable (Opcional) | |
| run: | | |
| # Empaqueta el repositorio en un único archivo .flatpak para facilitar su distribución directa | |
| flatpak build-bundle repo/ trinity-launcher.flatpak com.trench.trinity.launcher main | |
| - name: upload to hf | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: | | |
| python3 -m pip install -U "huggingface_hub[cli]" --break-system-packages | |
| FILE=trinity-launcher.flatpak | |
| FILE_NAME=$(basename "$FILE") | |
| hf upload ccoffee20/flatpak "$FILE" "$FILE_NAME" --repo-type dataset --token $HF_TOKEN | |
| hf upload ccoffee20/flatpak repo/ . --repo-type dataset --token $HF_TOKEN | |
| - name: 7. Subir Artefactos | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Trinity-Launcher-Flatpak-Repo | |
| path: | | |
| trinity-launcher.flatpak |