diff --git a/.github/workflows/cooker-selfhosted.yml b/.github/workflows/cooker-selfhosted.yml index 4e232e33..ff93253d 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" @@ -91,7 +90,7 @@ jobs: 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 @@ -178,10 +177,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 +204,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/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 faa296f0..0d1975bd 100644 --- a/functions/post_update.sh +++ b/functions/post_update.sh @@ -374,6 +374,61 @@ 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