diff --git a/.github/workflows/cooker-selfhosted.yml b/.github/workflows/cooker-selfhosted.yml index e24636bd..60264ac1 100644 --- a/.github/workflows/cooker-selfhosted.yml +++ b/.github/workflows/cooker-selfhosted.yml @@ -81,14 +81,19 @@ jobs: # Check if the event is related to a pull request if [[ "$GITHUB_EVENT_NAME" == "pull_request" || "$GITHUB_EVENT_NAME" == "pull_request_target" ]]; then - pr_number=$(echo "$GITHUB_REF" | awk -F'/' '{print $3}') - source_branch=$(curl -s "https://api.github.com/repos/RetroDECK/RetroDECK/pulls/$pr_number" | jq -r '.head.ref') - source_branch=${source_branch//\//-} # Replace '/' with '-' in the branch name + # Use GITHUB_HEAD_REF to get the source branch + source_branch="${GITHUB_HEAD_REF}" + + # Replace '/' with '-' in the branch name + source_branch=${source_branch//\//-} echo "[DEBUG] source branch is: $source_branch" - echo "TAG=PR-$pr_number-$(echo $source_branch-${{ env.buildid }} | sed 's/\//-/g')" >> $GITHUB_ENV - echo "MAKE_LATEST=false" >> $GITHUB_ENV # if it's a feature branch it will not marked as "latest" cooker version + + # Generate the tag for a pull request + echo "TAG=PR-$GITHUB_RUN_ID-$source_branch-${{ env.buildid }}" >> $GITHUB_ENV + echo "MAKE_LATEST=false" >> $GITHUB_ENV # Not marked as the latest cooker version if it's a feature branch else - TAG="$MANIFEST_VERSION-${{ env.buildid }} | sed 's/\//-/g'" + # Generate the tag for non-pull request branches + TAG="$MANIFEST_VERSION-${{ env.buildid }}" echo "TAG=$TAG" >> $GITHUB_ENV echo "MAKE_LATEST=true" >> $GITHUB_ENV fi diff --git a/config/retrodeck/reference_lists/features.json b/config/retrodeck/reference_lists/features.json index d2b4f976..bcb471b2 100644 --- a/config/retrodeck/reference_lists/features.json +++ b/config/retrodeck/reference_lists/features.json @@ -972,6 +972,12 @@ } ] }, + "ruffle": { + "description": "Flash Games emulator", + "name" : "Ruffle", + "system" : "flash", + "launch": "ruffle-rd-wrapper.sh" + }, "melonds": { "description": "MelonDS Nintendo DS Emulator", "name": "melonds", diff --git a/config/ruffle/ruffle-rdwrapper.sh b/config/ruffle/ruffle-rdwrapper.sh new file mode 100644 index 00000000..37ba0d89 --- /dev/null +++ b/config/ruffle/ruffle-rdwrapper.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +source /app/libexec/global.sh + +create_dir "$saves_folder/ruffle" + +static_invoke="--config /var/data/ruffle \ + --save-directory "$saves_folder/ruffle" \ + --fullscreen" + +#Check if Steam Deck in Desktop Mode +if [[ $(check_desktop_mode) == "true" ]]; then + ruffle --graphics vulkan $static_invoke "$@" +else + ruffle --graphics gl --no-gui $static_invoke "$@" +fi \ No newline at end of file diff --git a/functions/post_update.sh b/functions/post_update.sh index 5c8c12f3..faa296f0 100644 --- a/functions/post_update.sh +++ b/functions/post_update.sh @@ -379,6 +379,7 @@ post_update() { set_setting_value "$raconf" "libretro_info_path" "/var/config/retroarch/cores" "retroarch" prepare_component "reset" "shadps4" + prepare_component "reset" "ruffle" # TODO: check this # rm /var/config/emulationstation/.emulationstation # remving the old symlink to .emulationstation as it might be not needed anymore diff --git a/functions/prepare_component.sh b/functions/prepare_component.sh index 5c41b644..3d1696df 100644 --- a/functions/prepare_component.sh +++ b/functions/prepare_component.sh @@ -865,7 +865,24 @@ prepare_component() { log i "----------------------" # TODO: plceholder + fi + if [[ "$component" =~ ^(ruffle|all)$ ]]; then + component_found="true" + log i "----------------------" + log i "Prepearing Ruffle" + log i "----------------------" + + rm -rf "/var/config/ruffle" + + # Ruffle creates a directory with the full rom paths in it, so this is necessary + # TODO: be aware of this when multi user support will be integrated for this component + dir_prep "$saves_folder/flash" "/var/data/ruffle/SharedObjects/localhost/$roms_folder/flash" + + if [[ "$action" == "postmove" ]]; then # Run only post-move commands + dir_prep "$saves_folder/flash" "/var/data/ruffle/SharedObjects/localhost/$roms_folder/flash" + fi + fi if [[ $component_found == "false" ]]; then diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 7a1c9161..58780f41 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -566,6 +566,20 @@ modules: url: https://github.com/RetroDECK/RetroDECK-theme commit: 975c41cac99d150b6ae86a1dfd19988058c69aad + # RUFFLE - START + # https://github.com/ruffle-rs/ruffle/releases + - name: ruffle + buildsystem: simple + build-commands: + - | + cp -p ruffle "${FLATPAK_DEST}/bin/" + chmod +x "${FLATPAK_DEST}/bin/ruffle" + sources: + - type: archive + strip-components: 0 + url: https://github.com/ruffle-rs/ruffle/releases/download/nightly-2024-08-09/ruffle-nightly-2024_08_09-linux-x86_64.tar.gz + sha256: d2c4c77d8426da6df8dc8b2a57565c151146464a8eec605d5faa68a297d8cad6 + - name: fetch-missing-libs buildsystem: simple build-commands: @@ -661,6 +675,10 @@ modules: - cp config/gzdoom/gzdoom.sh ${FLATPAK_DEST}/bin/gzdoom.sh - chmod +x ${FLATPAK_DEST}/bin/gzdoom.sh + # RUFFLE wrapper + - cp config/ruffle/ruffle-rdwrapper.sh "${FLATPAK_DEST}/bin/ruffle-rdwrapper.sh" + - chmod +x "${FLATPAK_DEST}/bin/ruffle-rdwrapper.sh" + sources: - type: git url: THISREPO diff --git a/tools/configurator/data_list.json b/tools/configurator/data_list.json index a671ea71..9f8a400d 100644 --- a/tools/configurator/data_list.json +++ b/tools/configurator/data_list.json @@ -405,4 +405,4 @@ ] } } -} \ No newline at end of file +}