From e527f85ca66127cd94c30dff1cb16ace597ac8c1 Mon Sep 17 00:00:00 2001 From: icenine451 Date: Fri, 5 May 2023 16:20:49 -0400 Subject: [PATCH] Update pre-build automation Now information can be read from the general server environment to inject into the flatpak manifest --- .github/workflows/cooker-selfhosted.yml | 2 +- automation_tools/automation_task_list.cfg | 1 + automation_tools/pre_build_automation.sh | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cooker-selfhosted.yml b/.github/workflows/cooker-selfhosted.yml index 1465112e..c68993d4 100644 --- a/.github/workflows/cooker-selfhosted.yml +++ b/.github/workflows/cooker-selfhosted.yml @@ -39,7 +39,7 @@ jobs: word2=$(curl -s https://random-word-api.herokuapp.com/word?length=5 | tr -d '[]"') capitalized_word2="$(tr '[:lower:]' '[:upper:]' <<< ${word2:0:1})${word2:1}" result=$capitalized_word1$capitalized_word2 - echo $result >> ${GITHUB_WORKSPACE}/buildid + echo $result > ${GITHUB_WORKSPACE}/buildid ls -lah ${GITHUB_WORKSPACE} # DEBUG cat ${GITHUB_WORKSPACE}/buildid # DEBUG echo "buildid=$result" >> $GITHUB_ENV diff --git a/automation_tools/automation_task_list.cfg b/automation_tools/automation_task_list.cfg index f3001422..2c28ed28 100644 --- a/automation_tools/automation_task_list.cfg +++ b/automation_tools/automation_task_list.cfg @@ -4,3 +4,4 @@ hash^DOOMSHAPLACEHOLDER^https://buildbot.libretro.com/assets/cores/DOOM/Doom%20% 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 latestcommit^UNIVERSALDYNAMICINPUTCOMMITPLACEHOLDER^https://github.com/Venomalia/UniversalDynamicInput^main +outside_info^VERSIONPLACEHOLDER^${GITHUB_WORKSPACE}/buildid diff --git a/automation_tools/pre_build_automation.sh b/automation_tools/pre_build_automation.sh index b02225c4..637c3f95 100644 --- a/automation_tools/pre_build_automation.sh +++ b/automation_tools/pre_build_automation.sh @@ -53,6 +53,15 @@ do appimagehash=$(curl -sL "$appimageurl" | sha256sum | cut -d ' ' -f1) echo "AppImage hash found: $appimagehash" /bin/sed -i 's^'"HASHFOR$placeholder"'^'"$appimagehash"'^' $rd_manifest + elif [[ "$action" == "outside_info" ]]; then + if [[ "$url" = \$* ]]; then # If value is a reference to a variable name + eval url="$url" + fi + echo + echo "Placeholder text: $placeholder" + echo "Information being injected: $(cat $url)" + echo + /bin/sed -i 's^'"$placeholder"'^'"$(cat $url)"'^' $rd_manifest fi fi done < "$automation_task_list"