diff --git a/.github/workflows/cooker-selfhosted.yml b/.github/workflows/cooker-selfhosted.yml index 4e232e33..95e05038 100644 --- a/.github/workflows/cooker-selfhosted.yml +++ b/.github/workflows/cooker-selfhosted.yml @@ -5,19 +5,17 @@ on: branches: - cooker* - feat* + - branch/cooker* paths: - '.github/workflows/**' - 'automation_tools/**' - 'config/**' - - 'config/es-de/**' - 'functions/**' - 'rd-submodules/**' - '*.sh' - 'net.retrodeck.retrodeck.yml' - 'net.retrodeck.retrodeck.appdata.xml' - pull_request_target: - branches: - - cooker* + pull_request: # Italy (CET): 11:00 PM # Japan (JST): 7:00 AM @@ -33,7 +31,7 @@ jobs: Building_RetroDECK: runs-on: retrodeck - steps: + steps: # Circumventing this bug: https://github.com/flatpak/flatpak-builder/issues/317 - name: Remove stuck mounts @@ -43,6 +41,7 @@ jobs: continue-on-error: true - name: Generate a token for Rekku + if: ${{ github.repository == 'RetroDECK/RetroDECK' }} id: generate-rekku-token uses: actions/create-github-app-token@v1 with: @@ -55,7 +54,7 @@ jobs: uses: actions/checkout@v4 with: submodules: 'true' - + - name: "Install dependencies" run: "automation_tools/install_dependencies.sh" @@ -86,14 +85,20 @@ jobs: # Use GITHUB_HEAD_REF to get the source branch source_branch="${GITHUB_HEAD_REF}" + # Replace '/' with '-' in the branch name + source_branch=${source_branch//\//-} + # 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" # Generate the tag for a pull request - echo "TAG=PR-$GITHUB_RUN_ID-$source_branch-${{ env.buildid }}" >> $GITHUB_ENV + echo "TAG=PR-$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 + # Generate the tag for non-pull request branches # Generate the tag for non-pull request branches TAG="$MANIFEST_VERSION-${{ env.buildid }}" echo "TAG=$TAG" >> $GITHUB_ENV @@ -178,10 +183,11 @@ jobs: allowUpdates: true makeLatest: ${{env.MAKE_LATEST}} # if it's a feat branch is not considered the latest build token: ${{ steps.generate-rekku-token.outputs.token }} - repo: Cooker + repo: ${{ github.repository_owner == 'RetroDECK' && 'Cooker' || github.event.repository.name }} # "Cooker" if we are in RetroDECK Org, else "this repo" continue-on-error: true - name: Rewrite Tag + if: ${{ github.repository == 'RetroDECK/RetroDECK' }} run: | git submodule deinit -f --all git fetch --tags @@ -204,14 +210,6 @@ jobs: path: RetroDECK-cooker.flatpak continue-on-error: true - - name: Create Artifact for flathub - run: | - tar -czf ${GITHUB_WORKSPACE}/RetroDECK-Artifact-cooker.tar.gz -C ${GITHUB_WORKSPACE}/retrodeck-flatpak-cooker . - hash=($(sha256sum ${GITHUB_WORKSPACE}/RetroDECK-Artifact-cooker.tar.gz)) - echo $hash > ${GITHUB_WORKSPACE}/RetroDECK-Artifact-cooker.sha - mv -f RetroDECK-Artifact-cooker.* ${{ secrets.ARTIFACT_REPO }} - continue-on-error: true - # - name: Upload RetroDECK-cooker.flatpak to Gitea Release # run: | # # Set variables for Gitea host, organization, repository, access token, and release details 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/configurator_functions.sh b/functions/configurator_functions.sh index 32f11a7f..db7f9c4d 100644 --- a/functions/configurator_functions.sh +++ b/functions/configurator_functions.sh @@ -5,10 +5,6 @@ check_bios_files() { # There is a "basic" and "expert" mode which outputs different levels of data # USAGE: check_bios_files "mode" - if [[ -f "$godot_bios_files_checked" ]]; then - rm -f "$godot_bios_files_checked" # Godot data transfer temp files - fi - touch "$godot_bios_files_checked" while IFS="^" read -r bios_file bios_subdir bios_hash bios_system bios_desc || [[ -n "$bios_file" ]]; do @@ -25,10 +21,10 @@ check_bios_files() { fi if [[ "$1" == "basic" ]]; then bios_checked_list=("${bios_checked_list[@]}" "$bios_file" "$bios_system" "$bios_file_found" "$bios_hash_matched" "$bios_desc") - echo "$bios_file"^"$bios_system"^"$bios_file_found"^"$bios_hash_matched"^"$bios_desc" >> "$godot_bios_files_checked" # Godot data transfer temp file + echo "$bios_file"^"$bios_system"^"$bios_file_found"^"$bios_hash_matched"^"$bios_desc" # Godot data transfer else bios_checked_list=("${bios_checked_list[@]}" "$bios_file" "$bios_system" "$bios_file_found" "$bios_hash_matched" "$bios_desc" "$bios_subdir" "$bios_hash") - echo "$bios_file"^"$bios_system"^"$bios_file_found"^"$bios_hash_matched"^"$bios_desc"^"$bios_subdir"^"$bios_hash" >> "$godot_bios_files_checked" # Godot data transfer temp file + echo "$bios_file"^"$bios_system"^"$bios_file_found"^"$bios_hash_matched"^"$bios_desc"^"$bios_subdir"^"$bios_hash" # Godot data transfer fi fi done < $bios_checklist diff --git a/functions/global.sh b/functions/global.sh index f00f6914..b0a62c0f 100644 --- a/functions/global.sh +++ b/functions/global.sh @@ -45,7 +45,7 @@ remote_network_target_2="$rd_repo" remote_network_target_3="https://one.one.one.one" # The URL of a common internet target for testing network access helper_files_folder="$config/retrodeck/helper_files" # The parent folder of RetroDECK documentation files for deployment rd_appdata="/app/share/appdata/net.retrodeck.retrodeck.appdata.xml" # The shipped appdata XML file for this version -rpcs3_firmware="http://dus01.ps3.update.playstation.net/update/ps3/image/us/2023_0228_05fe32f5dc8c78acbcd84d36ee7fdc5b/PS3UPDAT.PUP" +rpcs3_firmware="http://dus01.ps3.update.playstation.net/update/ps3/image/us/2024_0227_3694eb3fb8d9915c112e6ab41a60c69f/PS3UPDAT.PUP" RA_API_URL="https://retroachievements.org/dorequest.php" # API URL for RetroAchievements.org presets_dir="$config/retrodeck/presets" # Repository for all system preset config files git_organization_name="RetroDECK" # The name of the organization in our git repository such as GitHub diff --git a/functions/post_update.sh b/functions/post_update.sh index 146a8d10..8fa5338e 100644 --- a/functions/post_update.sh +++ b/functions/post_update.sh @@ -374,10 +374,66 @@ post_update() { fi fi + # Check if the version is older than 0.8.4b + if [[ $(check_version_is_older_than "0.8.4b") == "true" ]]; then + # In version 0.8.4b, the following changes were made: + # - Recovery from a failed move of the themes, downloaded_media and gamelists folder to their new ES-DE locations (AGAIN) + + log d "Injecting the new retrodeck/ES-DE subdir into the retrodeck.cfg" + # Check if ES-DE already exists in media_folder or themes_folder + if grep -E '^(media_folder|themes_folder)=.*ES-DE' "$rd_conf"; then + log d "ES-DE path already exists in media_folder or themes_folder" + else + # Update the paths if ES-DE does not exist + sed -i -e '/media_folder=/s|retrodeck/|retrodeck/ES-DE/|g' -e '/themes_folder=/s|retrodeck/|retrodeck/ES-DE/|g' "$rd_conf" && log d "Injection successful" + fi + log d "$(grep media_folder "$rd_conf")" + log d "$(grep themes_folder "$rd_conf")" + conf_read + conf_write + + log i "Checking if ES-DE downloaded_media, gamelist, and themes folder must be migrated from \"$rdhome\" to \"$rdhome/ES-DE\" due to a RetroDECK Framework bug" + + # Use rsync to merge directories and overwrite existing files + if [[ -d "$rdhome/themes" ]]; then + rsync -a "$rdhome/themes/" "$rdhome/ES-DE/themes/" && log d "Move of \"$rdhome/themes\" to \"$rdhome/ES-DE/themes\" completed" + rm -rf "$rdhome/themes" # Remove the original directory after merging + else + log i "ES-DE themes appear to have already been migrated." + fi + + if [[ -d "$rdhome/downloaded_media" ]]; then + rsync -a "$rdhome/downloaded_media/" "$rdhome/ES-DE/downloaded_media/" && log d "Move of \"$rdhome/downloaded_media\" to \"$rdhome/ES-DE/downloaded_media\" completed" + rm -rf "$rdhome/downloaded_media" # Remove the original directory after merging + else + log i "ES-DE downloaded media appear to have already been migrated." + fi + + if [[ -d "$rdhome/gamelists" ]]; then + rsync -a "$rdhome/gamelists/" "$rdhome/ES-DE/gamelists/" && log d "Move of \"$rdhome/gamelists\" to \"$rdhome/ES-DE/gamelists\" completed" + rm -rf "$rdhome/gamelists" # Remove the original directory after merging + else + log i "ES-DE gamelists appear to have already been migrated." + fi + + if [[ -d "$rdhome/collections" ]]; then + rsync -a "$rdhome/collections/" "$rdhome/ES-DE/collections/" && log d "Move of \"$rdhome/collections\" to \"$rdhome/ES-DE/collections\" completed" + rm -rf "$rdhome/collections" # Remove the original directory after merging + else + log i "ES-DE collections appear to have already been migrated." + fi + + # Setting the correct variables once again + set_setting_value "$es_settings" "MediaDirectory" "$media_folder" "es_settings" + set_setting_value "$es_settings" "UserThemeDirectory" "$themes_folder" "es_settings" + + fi + if [[ $(check_version_is_older_than "0.9.0b") == "true" ]]; then # Placeholder for version 0.9.0b set_setting_value "$raconf" "libretro_info_path" "/var/config/retroarch/cores" "retroarch" + 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 137a5bbe..ac3e47b9 100644 --- a/functions/prepare_component.sh +++ b/functions/prepare_component.sh @@ -857,6 +857,24 @@ prepare_component() { sed -i 's#RETRODECKSAVESDIR#'$saves_folder'#g' "/var/config/gzdoom/gzdoom.ini" # This is an unfortunate one-off because set_setting_value does not currently support JSON 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 log e "Supplied component $component not found, not resetting" fi diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index b095d7e1..acda1f52 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -549,6 +549,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: @@ -644,6 +658,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 +}