Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1b7bf4e3a4 | |||
| fcfef8da78 | |||
| b022c236b6 | |||
| 2aa4d0d387 |
@@ -1,152 +0,0 @@
|
|||||||
name: Build and Publish O3DE Flatpak
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 2 * * *' # Täglich um 2:00 Uhr prüfen
|
|
||||||
workflow_dispatch: # Erlaubt manuelles Starten
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-flatpak:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: ubuntu:22.04
|
|
||||||
options: --privileged
|
|
||||||
steps:
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y curl ca-certificates jq sed flatpak flatpak-builder ostree git binutils xz-utils zstd
|
|
||||||
|
|
||||||
- name: Checkout repository
|
|
||||||
run: |
|
|
||||||
git init
|
|
||||||
git remote add origin "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@${GITHUB_SERVER_URL#*://}/${GITHUB_REPOSITORY}.git"
|
|
||||||
# Wir holen den aktuellen Commit
|
|
||||||
git fetch --depth 1 origin $GITHUB_SHA || git fetch --depth 1 origin main
|
|
||||||
git reset --hard FETCH_HEAD
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Get latest version and download URL
|
|
||||||
id: check_version
|
|
||||||
run: |
|
|
||||||
DOWNLOAD_URL=$(curl -sL https://o3debinaries.org/download/linux.html | grep -oP 'href="[^"]+\.deb"' | head -n 1 | cut -d '"' -f 2)
|
|
||||||
echo "DOWNLOAD_URL=$DOWNLOAD_URL" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
VERSION=$(basename "$DOWNLOAD_URL" | sed 's/o3de_//;s/\.deb//;s/_/./g')
|
|
||||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
echo "Gefundene Version: $VERSION"
|
|
||||||
echo "URL: $DOWNLOAD_URL"
|
|
||||||
|
|
||||||
- name: Download O3DE .deb
|
|
||||||
run: |
|
|
||||||
echo "Lade $DOWNLOAD_URL herunter..."
|
|
||||||
curl -L -o o3de.deb "$DOWNLOAD_URL"
|
|
||||||
echo "Berechne Checksumme..."
|
|
||||||
sha256sum o3de.deb
|
|
||||||
|
|
||||||
- name: Build Flatpak (Manual Mode)
|
|
||||||
run: |
|
|
||||||
# Flathub hinzufügen, um Runtimes herunterladen zu können
|
|
||||||
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
|
||||||
flatpak install --user -y flathub org.freedesktop.Platform//23.08 org.freedesktop.Sdk//23.08
|
|
||||||
|
|
||||||
# 1. Initialisiere den Erstellungsordner
|
|
||||||
flatpak build-init build-dir org.o3de.O3DE org.freedesktop.Sdk org.freedesktop.Platform 23.08
|
|
||||||
|
|
||||||
# 2. Entpacke das .deb Paket
|
|
||||||
mkdir deb-extract
|
|
||||||
cd deb-extract
|
|
||||||
ar x ../o3de.deb
|
|
||||||
tar -xf data.tar.*
|
|
||||||
|
|
||||||
# 3. Kopiere die Dateien in den build-dir/files/ Ordner (entspricht /app im Flatpak)
|
|
||||||
mkdir -p ../build-dir/files/opt
|
|
||||||
if [ -d opt ]; then
|
|
||||||
cp -a opt/* ../build-dir/files/opt/
|
|
||||||
fi
|
|
||||||
if [ -d usr ]; then
|
|
||||||
cp -a usr/* ../build-dir/files/
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 4. Desktop-Datei umbenennen und anpassen (für Menü-Integration)
|
|
||||||
if [ -d ../build-dir/files/share/applications ]; then
|
|
||||||
cd ../build-dir/files/share/applications
|
|
||||||
DESKTOP_FILE=$(find . -name "*.desktop" | head -n 1)
|
|
||||||
if [ -n "$DESKTOP_FILE" ]; then
|
|
||||||
mv "$DESKTOP_FILE" org.o3de.O3DE.desktop
|
|
||||||
sed -i 's/^Icon=.*/Icon=org.o3de.O3DE/' org.o3de.O3DE.desktop
|
|
||||||
fi
|
|
||||||
cd -
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 5. Icons umbenennen, damit sie zur App-ID passen
|
|
||||||
if [ -d ../build-dir/files/share/icons ]; then
|
|
||||||
find ../build-dir/files/share/icons -name "*o3de*" | while read icon; do
|
|
||||||
dir=$(dirname "$icon")
|
|
||||||
ext="${icon##*.}"
|
|
||||||
mv "$icon" "$dir/org.o3de.O3DE.$ext"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
# Wrapper Skript kopieren und ausführbar machen
|
|
||||||
mkdir -p build-dir/files/bin
|
|
||||||
cp o3de-wrapper.sh build-dir/files/bin/o3de-wrapper.sh
|
|
||||||
chmod +x build-dir/files/bin/o3de-wrapper.sh
|
|
||||||
|
|
||||||
# 6. Abschließen des Erstellungsordners
|
|
||||||
flatpak build-finish build-dir \
|
|
||||||
--command=o3de-wrapper.sh \
|
|
||||||
--share=network \
|
|
||||||
--share=ipc \
|
|
||||||
--socket=x11 \
|
|
||||||
--socket=wayland \
|
|
||||||
--device=dri \
|
|
||||||
--filesystem=host
|
|
||||||
|
|
||||||
# 7. Exportiere in das lokale OSTree-Repository "repo"
|
|
||||||
flatpak build-export repo build-dir
|
|
||||||
|
|
||||||
# Aufräumen, um Platz zu sparen
|
|
||||||
rm -rf o3de.deb deb-extract build-dir
|
|
||||||
|
|
||||||
- name: Generate Static OSTree Summary
|
|
||||||
run: |
|
|
||||||
# Erstellt die statischen Zusammenfassungs-Dateien (summary und appstream), die für ein Web-Repo nötig sind
|
|
||||||
flatpak build-update-repo repo/
|
|
||||||
|
|
||||||
- name: Publish to Gitea Pages (pages branch)
|
|
||||||
run: |
|
|
||||||
# Git-Benutzer konfigurieren
|
|
||||||
git config --global user.name "Gitea Actions"
|
|
||||||
git config --global user.email "actions@gitea.local"
|
|
||||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
||||||
|
|
||||||
# Temporäres Verzeichnis für den Branch erstellen
|
|
||||||
mkdir -p pages-branch
|
|
||||||
cd pages-branch
|
|
||||||
|
|
||||||
# Authentifizierte URL für den Push erstellen
|
|
||||||
REPO_URL="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@${GITHUB_SERVER_URL#*://}/${GITHUB_REPOSITORY}.git"
|
|
||||||
|
|
||||||
# Versuchen den pages branch zu klonen. Wenn er nicht existiert, einen initialisieren.
|
|
||||||
if git clone --branch pages "$REPO_URL" . ; then
|
|
||||||
echo "Pages branch existiert bereits."
|
|
||||||
else
|
|
||||||
echo "Pages branch wird neu erstellt."
|
|
||||||
git init
|
|
||||||
git checkout -b pages
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Das gebaute Flatpak OSTree-Repo hineinkopieren (aktualisieren)
|
|
||||||
cp -a ../repo/* .
|
|
||||||
|
|
||||||
# Änderungen committen und pushen
|
|
||||||
git add .
|
|
||||||
git commit -m "Update Flatpak Repo for O3DE v${VERSION}" || echo "Keine Änderungen zum Committen."
|
|
||||||
git push "$REPO_URL" pages
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# O3DE Flatpak Wrapper Script
|
|
||||||
|
|
||||||
# Bibliotheken aus dem Flatpak-Bundle zum LD_LIBRARY_PATH hinzufügen
|
|
||||||
export LD_LIBRARY_PATH="/app/opt/O3DE/lib:/app/lib:$LD_LIBRARY_PATH"
|
|
||||||
|
|
||||||
# Finde das Haupt-Executable von O3DE. Meist ist es in /app/opt/O3DE/bin/Linux/profile/Default/o3de oder ähnlich.
|
|
||||||
O3DE_BIN=$(find /app/opt -type f -executable -name "o3de" | head -n 1)
|
|
||||||
|
|
||||||
if [ -z "$O3DE_BIN" ]; then
|
|
||||||
echo "Fehler: O3DE Executable wurde im Paket nicht gefunden!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Starte O3DE: $O3DE_BIN"
|
|
||||||
exec "$O3DE_BIN" "$@"
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user