Adding manifest and workflow

This commit is contained in:
XargonWan 2024-08-24 00:01:32 +09:00
parent 6638c847c6
commit 0701a4124b
7 changed files with 233 additions and 0 deletions

103
.github/workflows/build_artifacts.yml vendored Normal file
View file

@ -0,0 +1,103 @@
name: "Build supermodel Artifacts for RetroDECK"
on:
push:
branches:
- master
workflow_dispatch:
jobs:
Building_Supermodel:
runs-on: ubuntu-latest
steps:
# Circumventing this bug: https://github.com/flatpak/flatpak-builder/issues/317
# - name: Remove stuck mounts
# run: sudo umount -f /home/ubuntu/supermodel-runner/_work/Supermodel/Supermodel/.flatpak-builder/rofiles/*
# continue-on-error: true
- name: Clone repo
uses: actions/checkout@v3
with:
submodules: 'true'
token: ${{ secrets.TRIGGER_BUILD_TOKEN }}
- name: "Install dependencies"
run: "automation_tools/install_dependencies.sh"
# - name: "Creating supermodel manifest"
# run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/update_supermodel_manifest.sh"
# - name: "[DEBUG] Outputting manifest"
# run: cat net.retrodeck.supermodel.yml
- name: "Build flatpak"
id: "flatpak-download"
run: |
git config --global protocol.file.allow always
flatpak-builder --user --force-clean \
--install-deps-from=flathub \
--install-deps-from=flathub-beta \
--repo=${GITHUB_WORKSPACE}/supermodel-repo \
"${GITHUB_WORKSPACE}"/supermodel-build-dir \
net.retrodeck.supermodel.yaml
- name: "Exporting dir tree"
id: tree
run: tree -H ./ > ${GITHUB_WORKSPACE}/tree.html
- name: Create Artifact for RetroDECK
run: |
tar -czf ${GITHUB_WORKSPACE}/Supermodel-Artifact.tar.gz -C ${GITHUB_WORKSPACE}/supermodel-build-dir .
hash=($(sha256sum ${GITHUB_WORKSPACE}/Supermodel-Artifact.tar.gz))
echo $hash > ${GITHUB_WORKSPACE}/RetroDECK-Artifact-cooker.sha
mv -f RetroDECK-Artifact-cooker.* ${{ secrets.ARTIFACT_REPO }}
continue-on-error: true
timeout-minutes: 1440
- name: Set environment variable with current branch name
run: echo "GITHUB_REF_SLUG=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
- name: Get branch name
id: branch_name
run: echo "BRANCH_NAME=$(echo $GITHUB_REF | sed 's|refs/heads/||')" >> $GITHUB_ENV
- name: Get date
id: date
run: echo "DATE=$(date +'%d%m%y.%S')" >> $GITHUB_ENV
- name: Publish the artifacts in a new release
uses: ncipollo/release-action@v1
with:
tag: "${{env.BRANCH_NAME}}-${{env.DATE}}"
body: |
# Release Notes
These are the artifact of RetroDECK supermodel, commit: ${{ github.event.repository.full_name }}@${{github.sha}}.
On branch [${{env.BRANCH_NAME}}](https://github.com/XargonWan/Supermodel/tree/${{env.BRANCH_NAME}}).
artifacts: "Supermodel-Artifact.tar.gz, tree.html"
allowUpdates: true
makeLatest: true
token: ${{ secrets.TRIGGER_BUILD_TOKEN }}
continue-on-error: true
# - name: "Committing changes"
# with:
# github_token: ${{ secrets.TRIGGER_BUILD_TOKEN }}
# run: |
# git config user.name "GitHub Actions"
# git config user.email "actions@github.com"
# git add * net.retrodeck.supermodel.yml
# git commit -m '[AUTOMATED] Updating supermodel after build [skip ci]'
# git push origin main
# continue-on-error: true # TODO: would be good to update the manifest but it's broken
# - name: GitHub Commit & Push
# uses: actions-js/push@v1.4
# with:
# github_token: ${{ secrets.TRIGGER_BUILD_TOKEN }}
# message: '[AUTOMATED] Updating supermodel after build [skip ci]'
# branch: retrodeck-main
# continue-on-error: true # TODO: would be good to update the manifest but it's broken

View file

@ -0,0 +1,31 @@
#!/bin/bash
# This script is installing the required dependencies to correctly run the pipeline and build the flatpak
unset pkg_mgr
# rpm-ostree must be checked before dnf because a dnf (wrapper) command also works on rpm-ostree distros (not what we want)
for potential_pkg_mgr in apt pacman rpm-ostree dnf; do
command -v "$potential_pkg_mgr" &> /dev/null && pkg_mgr="$potential_pkg_mgr" && break
done
case "$pkg_mgr" in
apt)
sudo apt install -y flatpak flatpak-builder p7zip-full xmlstarlet bzip2 curl jq
;;
pacman)
sudo pacman -S --noconfirm flatpak flatpak-builder p7zip xmlstarlet bzip2
;;
rpm-ostree)
echo "When using a distro with rpm-ostree, you shouldn't build directly on the host. Try using a distrobox."
exit 1
;;
dnf)
sudo dnf install -y flatpak flatpak-builder p7zip p7zip-plugins xmlstarlet bzip2 curl
;;
*)
echo "Package manager $pkg_mgr not supported. Please open an issue."
;;
esac
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak remote-add --user --if-not-exists flathub-beta https://flathub.org/beta-repo/flathub-beta.flatpakrepo

View file

@ -0,0 +1,22 @@
#!/bin/bash
git clone https://github.com/XargonWan/RetroDECK --depth=1 RetroDECK
# Creating MAME manifest
manifest_header="manifest-header.yml"
module="module.yml"
output_manifest="net.retrodeck.supermodel.yml"
command="/app/bin/supermodel"
# sed -n '/command/q;p' RetroDECK/net.retrodeck.retrodeck.yml > "$manifest_header" TEMPORARY DISABLED TO TRY A BUILD WITH ANOTHER RUNTIME
echo -e "command: $command\n" >> "$manifest_header"
sed -i '/^[[:space:]]*#/d' "$manifest_header"
sed -i 's/[[:space:]]*#.*$//' "$manifest_header"
sed -n '/finish-args:/,${/cleanup:/q;p;}' RetroDECK/net.retrodeck.retrodeck.yml >> "$manifest_header"
sed -i 's/net.retrodeck.retrodeck/net.retrodeck.supermodel/' "$manifest_header"
cat "$manifest_header" > "$output_manifest"
cat "$module" >> "$output_manifest"
rm -rf RetroDECK

37
manifest-header.yml Normal file
View file

@ -0,0 +1,37 @@
app-id: net.retrodeck.supermodel
runtime: org.kde.Platform
# runtime-version: "6.5"
runtime-version: 5.15-23.08 # maybe solving the libflac issue?
sdk: org.kde.Sdk
command: /app/bin/mame
finish-args:
- --socket=wayland
- --socket=x11
- --socket=pulseaudio
- --share=ipc
- --share=network
- --device=all
- --filesystem=host
- --filesystem=home/.var/app/com.valvesoftware.Steam
- --allow=multiarch
- --talk-name=org.freedesktop.ScreenSaver
- --talk-name=org.freedesktop.PowerManagement.Inhibit
- --talk-name=org.freedesktop.login1.Manager
- --filesystem=xdg-run/app/com.discordapp.Discord:create
- --filesystem=xdg-config/gtk-3.0:ro
- --env=QT_QPA_PLATFORM=wayland;wayland-egl;xcb
# Dolphin
- --allow=bluetooth
# It allows an SDL application to specify its window class, which can be useful for window managers and desktop environments to identify and group similar windows
- --env=SDL_VIDEO_X11_WMCLASS=net.retrodeck.retrodeck
- --env=SDL_VIDEO_WAYLAND_WMCLASS=net.retrodeck.retrodeck
# XEMU - Fixes issues with openSUSE systems, QEMU_AUDIO_DRV is defined as "pa" causing xemu to not launch
- --unset-env=QEMU_AUDIO_DRV
# BoilR
- --filesystem=xdg-data/Steam:rw #Steam (flatpak)
- --filesystem=~/.steam:rw # Steam (Non-flatpak)
- --filesystem=~/.var/app/com.valvesoftware.Steam:rw # Steam (Flatpak)
# PPSSPP, DOLPHIN
- --filesystem=xdg-run/gamescope-0:ro

6
module.yml Normal file
View file

@ -0,0 +1,6 @@
modules:
- name: supermodel
buildsystem: simple
build-commands:
- make -f Makefiles/Makefile.UNIX NET_BOARD=1

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>net.retrodeck.supermodel.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0</project_license>
<name>supermodel Launcher</name>
<summary>Browse and play your supermodel quest collection.</summary>
<description>
<p>
supermodel Launcher is a desktop GUI frontend that allows to browse and play to supermodel quests, which are video games made with the supermodel game engine.
</p>
</description>
<screenshots>
<screenshot type="default">
<image>https://www.supermodel-games.org/data/en/entities/article/old/2016/07/images/supermodel-launcher.png</image>
</screenshot>
</screenshots>
<url type="homepage">https://www.supermodel-games.org/</url>
<update_contact>christopho@supermodel-games.org</update_contact>
<launchable type="desktop-id">net.retrodeck.supermodel.desktop</launchable>
<project_group>supermodel</project_group>
<developer_name>supermodel Team</developer_name>
<content_rating type="oars-1.1">
<content_attribute id="violence-cartoon">moderate</content_attribute>
<content_attribute id="violence-bloodshed">mild</content_attribute>
</content_rating>
<releases>
<release version="1.6.5" date="2021-04-06" />
</releases>
</component>

4
update_from_upstream.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
git fetch https://github.com/flathub/net.retrodeck.supermodel master # Fetch the latest changes from the remote master branch
git merge FETCH_HEAD # Merge the fetched changes into your current branch