diff --git a/automation_tools/automation_task_list.cfg b/automation_tools/automation_task_list.cfg index 979b5998..3f70fe7e 100644 --- a/automation_tools/automation_task_list.cfg +++ b/automation_tools/automation_task_list.cfg @@ -24,3 +24,6 @@ hash^RETRODECKMELONDSLATEST^https://github.com/RetroDECK/net.kuribo64.melonDS/re hash^RETRODECKSOLARUSLATEST^https://github.com/RetroDECK/org.solarus_games.solarus.Launcher/releases/latest/download/RetroDECK-solarus-Artifact.tar.gz hash^RETRODECKGZDOOMLATEST^https://github.com/RetroDECK/org.zdoom.GZDoom/releases/latest/download/RetroDECK-gzdoom-Artifact.tar.gz hash^RETRODECKMAMELATEST^https://github.com/RetroDECK/MAME/releases/latest/download/RetroDECK-MAME-Artifact.tar.gz + +#This will replace RETRODECKSHADPS4LATESTURL with the URL of the latest artifact and RETRODECKSHADPS4LATESTSHA with its SHA256 hash. +latestghaartifact^RETRODECKSHADPS4LATESTURL^RETRODECKSHADPS4LATESTSHA^https://github.com/shadps4-emu/shadPS4/actions/workflows/linux-qt.yml^shadps4-linux-qt diff --git a/automation_tools/pre_build_automation.sh b/automation_tools/pre_build_automation.sh index c05a9879..dd8d63fd 100755 --- a/automation_tools/pre_build_automation.sh +++ b/automation_tools/pre_build_automation.sh @@ -188,8 +188,44 @@ handle_thisrepo() { /bin/sed -i 's^'"$placeholder"'^'"$current_repo_url"'^g' "$rd_manifest" } +# New function to handle the latest artifact from GitHub Actions +handle_latestghaartifact() { + local placeholder_url="$1" + local placeholder_hash="$2" + local workflow_url="$3" + local artifact_name="$4" + + echo "Fetching workflow runs from: $workflow_url" + workflow_runs_url=$(echo "$workflow_url" | sed 's/github.com/api.github.com\/repos/' | sed 's/actions\/workflows\/[^\/]*$/actions\/runs/') + + local runs_data=$(curl -s "$workflow_runs_url") + local latest_run_url=$(echo "$runs_data" | jq -r ".workflow_runs[0].artifacts_url") + + if [[ -z "$latest_run_url" ]]; then + echo "Error: No workflow runs found" + exit 1 + fi + + echo "Fetching artifacts from the latest run: $latest_run_url" + local artifacts_data=$(curl -s "$latest_run_url") + local artifact_url=$(echo "$artifacts_data" | jq -r ".artifacts[] | select(.name == \"$artifact_name\").archive_download_url") + + if [[ -z "$artifact_url" ]]; then + echo "Error: No artifact found with name $artifact_name" + exit 1 + fi + + echo "Downloading the artifact to calculate the hash..." + local artifact_hash=$(curl -sL "$artifact_url" | sha256sum | cut -d ' ' -f1) + + echo "Replacing placeholder $placeholder_url with artifact URL $artifact_url" + echo "Replacing placeholder $placeholder_hash with artifact hash $artifact_hash" + /bin/sed -i 's^'"$placeholder_url"'^'"$artifact_url"'^g' "$rd_manifest" + /bin/sed -i 's^'"$placeholder_hash"'^'"$artifact_hash"'^g' "$rd_manifest" +} + # Process the task list -while IFS="^" read -r action placeholder url branch || [[ -n "$action" ]]; do +while IFS="^" read -r action placeholder url branch artifact_name || [[ -n "$action" ]]; do if [[ ! "$action" == "#"* ]] && [[ -n "$action" ]]; then case "$action" in "branch" ) handle_branch "$placeholder" ;; @@ -203,6 +239,7 @@ while IFS="^" read -r action placeholder url branch || [[ -n "$action" ]]; do "custom_command" ) handle_custom_command "$url" ;; "url" ) handle_url "$placeholder" "$url" ;; "THISREPO" ) handle_thisrepo "$placeholder" ;; + "latestghaartifact" ) handle_latestghaartifact "$placeholder" "$branch" "$url" "$artifact_name" ;; esac fi done < "$automation_task_list" diff --git a/config/retrodeck/reference_lists/features.json b/config/retrodeck/reference_lists/features.json index 619b0077..fac71c95 100644 --- a/config/retrodeck/reference_lists/features.json +++ b/config/retrodeck/reference_lists/features.json @@ -627,6 +627,9 @@ "ps3": { "name": "Sony PlayStation 3" }, + "ps4": { + "name": "Sony PlayStation 4" + }, "psp": { "name": "Sony PlayStation Portable" }, @@ -1092,6 +1095,12 @@ "name": "xemu", "system": "xbox", "launch": "xemu" + }, + "shadps4" : { + "description": "PS4 Emulator for Linux", + "name": "shadps4", + "system": "ps4", + "launch": "shadps4-qt" } } } diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 24ea13a4..7202b111 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -524,6 +524,22 @@ modules: url: https://github.com/RetroDECK/MAME/releases/latest/download/RetroDECK-MAME-Artifact.tar.gz sha256: RETRODECKMAMELATEST + # SHADPS4 + + - name: shadps4 + buildsystem: simple + build-commands: + - unzip shadps4-linux-qt.zip + - chmod +x *.AppImage + - ./*.AppImage --appimage-extract + - mkdir -p "${FLATPAK_DEST}/retrodeck/tmplib" "${FLATPAK_DEST}/retrodeck/tmplib/debug" + - mv "squashfs-root/usr/lib/"* "${FLATPAK_DEST}/retrodeck/tmplib" + - cp -r squashfs-root/usr/* "${FLATPAK_DEST}/" + sources: + - type: file + url: RETRODECKSHADPS4LATESTURL + sha256: RETRODECKSHADPS4LATESTSHA + # ES-DE - name: ES-DE