From 2437d5c48968aa42354475d1aae4044da0cbd50a Mon Sep 17 00:00:00 2001 From: icenine451 Date: Fri, 25 Aug 2023 09:59:31 -0400 Subject: [PATCH 1/5] Cooker version automation --- .github/workflows/cooker-selfhosted.yml | 7 +------ .github/workflows/main-selfhosted.yml | 5 ----- automation_tools/automation_task_list.cfg | 1 + automation_tools/pre_build_automation.sh | 10 +++++++++- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cooker-selfhosted.yml b/.github/workflows/cooker-selfhosted.yml index debbfb76..f10f4b27 100644 --- a/.github/workflows/cooker-selfhosted.yml +++ b/.github/workflows/cooker-selfhosted.yml @@ -62,11 +62,6 @@ jobs: runtime/org.freedesktop.Platform.ffmpeg-full/x86_64/22.08 /bin/bash ${GITHUB_WORKSPACE}/automation_tools/pre_build_automation.sh # Run pre-build automation tasks - - name: Setting branch in the manifest - run: | - sed -i "s/THISBRANCH/$(git rev-parse --abbrev-ref HEAD)/g" net.retrodeck.retrodeck.yml - echo "Branch name is: $(git rev-parse --abbrev-ref HEAD)" - - name: Build flatpak run: | git config --global protocol.file.allow always @@ -117,4 +112,4 @@ jobs: with: name: retrodeck-flatpak path: RetroDECK.flatpak - continue-on-error: true \ No newline at end of file + continue-on-error: true diff --git a/.github/workflows/main-selfhosted.yml b/.github/workflows/main-selfhosted.yml index 7cd7e44f..47381d0d 100644 --- a/.github/workflows/main-selfhosted.yml +++ b/.github/workflows/main-selfhosted.yml @@ -53,11 +53,6 @@ jobs: runtime/org.freedesktop.Platform.ffmpeg-full/x86_64/22.08 /bin/bash ${GITHUB_WORKSPACE}/automation_tools/pre_build_automation.sh # Run pre-build automation tasks - - name: Setting branch in the manifest - run: | - sed -i "s/branch: THISBRANCH/branch: $(git rev-parse --abbrev-ref HEAD)/g" net.retrodeck.retrodeck.yml - echo "Branch name is: $(git rev-parse --abbrev-ref HEAD)" - - name: Read manifest content id: read_manifest run: echo "::set-output name=file_content::$(cat net.retrodeck.retrodeck.yml)" diff --git a/automation_tools/automation_task_list.cfg b/automation_tools/automation_task_list.cfg index f1624f43..98321389 100644 --- a/automation_tools/automation_task_list.cfg +++ b/automation_tools/automation_task_list.cfg @@ -1,5 +1,6 @@ # The proper format for this file is # ACTION^PLACEHOLDERTEXT^URL^REPO(Optional) +branch^THISBRANCH # hash^DOOMSHAPLACEHOLDER^https://buildbot.libretro.com/assets/cores/DOOM/Doom%20%28Shareware%29.zip hash^VITASHAPLACEHOLDER^https://github.com/Vita3K/Vita3K/releases/download/continuous/ubuntu-latest.zip hash^DUCKSTATIONSHAPLACEHOLDER^https://github.com/stenzek/duckstation/releases/download/preview/DuckStation-x64.AppImage diff --git a/automation_tools/pre_build_automation.sh b/automation_tools/pre_build_automation.sh index 637c3f95..f4d56c62 100644 --- a/automation_tools/pre_build_automation.sh +++ b/automation_tools/pre_build_automation.sh @@ -15,6 +15,7 @@ rd_manifest=${GITHUB_WORKSPACE}/net.retrodeck.retrodeck.yml automation_task_list=${GITHUB_WORKSPACE}/automation_tools/automation_task_list.cfg +current_branch=$(git rev-parse --abbrev-ref HEAD) echo "Manifest location: $rd_manifest" echo "Automation task list location: $automation_task_list" @@ -23,10 +24,17 @@ echo "Task list contents:" cat "$automation_task_list" echo +# Update all collected information while IFS="^" read -r action placeholder url branch do if [[ ! $action == "#"* ]] && [[ ! -z "$action" ]]; then - if [[ "$action" == "hash" ]]; then + if [[ "$action" == "branch" ]]; then + echo + echo "Placeholder text: $placeholder" + echo "Current branch:" "$current_branch" + echo + /bin/sed -i 's^'"$placeholder"'^'"$current_branch"'^g' $rd_manifest + elif [[ "$action" == "hash" ]]; then echo echo "Placeholder text: $placeholder" echo "URL to hash: $url" From 507ad3a73e48b6c532960cb200d9de7d62b8b778 Mon Sep 17 00:00:00 2001 From: icenine451 Date: Wed, 30 Aug 2023 09:58:16 -0400 Subject: [PATCH 2/5] Use existing function for branch replacement --- automation_tools/automation_task_list.cfg | 2 +- automation_tools/pre_build_automation.sh | 8 +------- rd-submodules/retroarch | 2 +- rd-submodules/shared-modules | 2 +- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/automation_tools/automation_task_list.cfg b/automation_tools/automation_task_list.cfg index 98321389..a34f3878 100644 --- a/automation_tools/automation_task_list.cfg +++ b/automation_tools/automation_task_list.cfg @@ -1,6 +1,5 @@ # The proper format for this file is # ACTION^PLACEHOLDERTEXT^URL^REPO(Optional) -branch^THISBRANCH # hash^DOOMSHAPLACEHOLDER^https://buildbot.libretro.com/assets/cores/DOOM/Doom%20%28Shareware%29.zip hash^VITASHAPLACEHOLDER^https://github.com/Vita3K/Vita3K/releases/download/continuous/ubuntu-latest.zip hash^DUCKSTATIONSHAPLACEHOLDER^https://github.com/stenzek/duckstation/releases/download/preview/DuckStation-x64.AppImage @@ -10,3 +9,4 @@ hash^MSXBIOSHASHPLACEHOLDER^http://bluemsx.msxblue.com/rel_download/blueMSXv282f hash^XEMUHDDHASHPLACEHOLDER^https://github.com/mborgerson/xemu-hdd-image/releases/latest/download/xbox_hdd.qcow2.zip latestcommit^UNIVERSALDYNAMICINPUTCOMMITPLACEHOLDER^https://github.com/Venomalia/UniversalDynamicInput^main outside_info^VERSIONPLACEHOLDER^${GITHUB_WORKSPACE}/buildid +outside_info^THISBRANCH^$(git rev-parse --abbrev-ref HEAD) diff --git a/automation_tools/pre_build_automation.sh b/automation_tools/pre_build_automation.sh index f4d56c62..cdd1c59e 100644 --- a/automation_tools/pre_build_automation.sh +++ b/automation_tools/pre_build_automation.sh @@ -28,13 +28,7 @@ echo while IFS="^" read -r action placeholder url branch do if [[ ! $action == "#"* ]] && [[ ! -z "$action" ]]; then - if [[ "$action" == "branch" ]]; then - echo - echo "Placeholder text: $placeholder" - echo "Current branch:" "$current_branch" - echo - /bin/sed -i 's^'"$placeholder"'^'"$current_branch"'^g' $rd_manifest - elif [[ "$action" == "hash" ]]; then + if [[ "$action" == "hash" ]]; then echo echo "Placeholder text: $placeholder" echo "URL to hash: $url" diff --git a/rd-submodules/retroarch b/rd-submodules/retroarch index fbfdda61..0b1cfb79 160000 --- a/rd-submodules/retroarch +++ b/rd-submodules/retroarch @@ -1 +1 @@ -Subproject commit fbfdda61b3da092a71cc53999dd3e7b909f244e2 +Subproject commit 0b1cfb79e591e10488a3262d6b38db843c39a409 diff --git a/rd-submodules/shared-modules b/rd-submodules/shared-modules index 50314360..a2441b96 160000 --- a/rd-submodules/shared-modules +++ b/rd-submodules/shared-modules @@ -1 +1 @@ -Subproject commit 50314360ded6fa3b9f0b602513b1164b7a6636ed +Subproject commit a2441b964afefd8cd1cebcdf562c7878670daf42 From 221159eaebfc78628f9db99fba39dd797c4936c6 Mon Sep 17 00:00:00 2001 From: icenine451 Date: Wed, 30 Aug 2023 11:59:58 -0400 Subject: [PATCH 3/5] Branch rename automation again --- automation_tools/automation_task_list.cfg | 2 +- automation_tools/pre_build_automation.sh | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/automation_tools/automation_task_list.cfg b/automation_tools/automation_task_list.cfg index a34f3878..dd907e09 100644 --- a/automation_tools/automation_task_list.cfg +++ b/automation_tools/automation_task_list.cfg @@ -9,4 +9,4 @@ hash^MSXBIOSHASHPLACEHOLDER^http://bluemsx.msxblue.com/rel_download/blueMSXv282f hash^XEMUHDDHASHPLACEHOLDER^https://github.com/mborgerson/xemu-hdd-image/releases/latest/download/xbox_hdd.qcow2.zip latestcommit^UNIVERSALDYNAMICINPUTCOMMITPLACEHOLDER^https://github.com/Venomalia/UniversalDynamicInput^main outside_info^VERSIONPLACEHOLDER^${GITHUB_WORKSPACE}/buildid -outside_info^THISBRANCH^$(git rev-parse --abbrev-ref HEAD) +branch^THISBRANCH^$(git rev-parse --abbrev-ref HEAD) diff --git a/automation_tools/pre_build_automation.sh b/automation_tools/pre_build_automation.sh index cdd1c59e..f4d56c62 100644 --- a/automation_tools/pre_build_automation.sh +++ b/automation_tools/pre_build_automation.sh @@ -28,7 +28,13 @@ echo while IFS="^" read -r action placeholder url branch do if [[ ! $action == "#"* ]] && [[ ! -z "$action" ]]; then - if [[ "$action" == "hash" ]]; then + if [[ "$action" == "branch" ]]; then + echo + echo "Placeholder text: $placeholder" + echo "Current branch:" "$current_branch" + echo + /bin/sed -i 's^'"$placeholder"'^'"$current_branch"'^g' $rd_manifest + elif [[ "$action" == "hash" ]]; then echo echo "Placeholder text: $placeholder" echo "URL to hash: $url" From 6c95113cfe3d955c459b8fd736a8a8f88c75ed95 Mon Sep 17 00:00:00 2001 From: icenine451 Date: Wed, 30 Aug 2023 12:01:35 -0400 Subject: [PATCH 4/5] Remove excess info --- automation_tools/automation_task_list.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation_tools/automation_task_list.cfg b/automation_tools/automation_task_list.cfg index dd907e09..ebf7d98f 100644 --- a/automation_tools/automation_task_list.cfg +++ b/automation_tools/automation_task_list.cfg @@ -9,4 +9,4 @@ hash^MSXBIOSHASHPLACEHOLDER^http://bluemsx.msxblue.com/rel_download/blueMSXv282f hash^XEMUHDDHASHPLACEHOLDER^https://github.com/mborgerson/xemu-hdd-image/releases/latest/download/xbox_hdd.qcow2.zip latestcommit^UNIVERSALDYNAMICINPUTCOMMITPLACEHOLDER^https://github.com/Venomalia/UniversalDynamicInput^main outside_info^VERSIONPLACEHOLDER^${GITHUB_WORKSPACE}/buildid -branch^THISBRANCH^$(git rev-parse --abbrev-ref HEAD) +branch^THISBRANCH From 5e762cc056420fdff86c25286b0f13ee917c05f6 Mon Sep 17 00:00:00 2001 From: icenine451 Date: Wed, 30 Aug 2023 12:03:03 -0400 Subject: [PATCH 5/5] Sync to main repo --- .github/workflows/cooker-selfhosted.yml | 34 ++++++++++++++++++++++++- .github/workflows/main-selfhosted.yml | 29 +++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cooker-selfhosted.yml b/.github/workflows/cooker-selfhosted.yml index 7042d3f0..12062858 100644 --- a/.github/workflows/cooker-selfhosted.yml +++ b/.github/workflows/cooker-selfhosted.yml @@ -32,7 +32,10 @@ jobs: run: sudo umount -f /home/ubuntu/actions-runner/_work/RetroDECK/RetroDECK/.flatpak-builder/rofiles/* continue-on-error: true - - uses: actions/checkout@v3 + - name: Clone RetroDECK repo + uses: actions/checkout@v3 + with: + submodules: 'true' - name: Generate cooker build ID run: | @@ -59,6 +62,35 @@ jobs: sed -i "s/THISBRANCH/$(git rev-parse --abbrev-ref HEAD)/g" net.retrodeck.retrodeck.yml echo "Branch name is: $(git rev-parse --abbrev-ref HEAD)" + - name: "Build flatpak: download only" + id: "flatpak-download" + run: | + git config --global protocol.file.allow always + mkdir -vp ${GITHUB_WORKSPACE}/local + mkdir -vp ${GITHUB_WORKSPACE}/retrodeck-flatpak-cooker + flatpak-builder --user --force-clean \ + --install-deps-from=flathub \ + --install-deps-from=flathub-beta \ + --repo=${GITHUB_WORKSPACE}/local \ + --download-only \ + ${GITHUB_WORKSPACE}/retrodeck-flatpak-cooker \ + net.retrodeck.retrodeck.yml + + # Sometimes flatpak download fails, in this case it tries a second time + - name: "Build flatpak: download only (retry)" + if: steps.flatpak-download.outcome == 'failure' + run: | + git config --global protocol.file.allow always + mkdir -vp ${GITHUB_WORKSPACE}/local + mkdir -vp ${GITHUB_WORKSPACE}/retrodeck-flatpak-cooker + flatpak-builder --user --force-clean \ + --install-deps-from=flathub \ + --install-deps-from=flathub-beta \ + --repo=${GITHUB_WORKSPACE}/local \ + --download-only \ + ${GITHUB_WORKSPACE}/retrodeck-flatpak-cooker \ + net.retrodeck.retrodeck.yml + - name: Build flatpak run: | git config --global protocol.file.allow always diff --git a/.github/workflows/main-selfhosted.yml b/.github/workflows/main-selfhosted.yml index 8b3764f5..bf2fa44e 100644 --- a/.github/workflows/main-selfhosted.yml +++ b/.github/workflows/main-selfhosted.yml @@ -65,6 +65,35 @@ jobs: exit 1 fi + - name: "Build flatpak: download only" + id: "flatpak-download" + run: | + git config --global protocol.file.allow always + mkdir -vp ${GITHUB_WORKSPACE}/local + mkdir -vp ${GITHUB_WORKSPACE}/retrodeck-flatpak-cooker + flatpak-builder --user --force-clean \ + --install-deps-from=flathub \ + --install-deps-from=flathub-beta \ + --repo=${GITHUB_WORKSPACE}/local \ + --download-only \ + ${GITHUB_WORKSPACE}/retrodeck-flatpak-cooker \ + net.retrodeck.retrodeck.yml + + # Sometimes flatpak download fails, in this case it tries a second time + - name: "Build flatpak: download only (retry)" + if: steps.flatpak-download.outcome == 'failure' + run: | + git config --global protocol.file.allow always + mkdir -vp ${GITHUB_WORKSPACE}/local + mkdir -vp ${GITHUB_WORKSPACE}/retrodeck-flatpak-cooker + flatpak-builder --user --force-clean \ + --install-deps-from=flathub \ + --install-deps-from=flathub-beta \ + --repo=${GITHUB_WORKSPACE}/local \ + --download-only \ + ${GITHUB_WORKSPACE}/retrodeck-flatpak-cooker \ + net.retrodeck.retrodeck.yml + - name: Build flatpak run: | git config --global protocol.file.allow always