mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2024-11-24 23:15:39 +00:00
AUTOMATION: urls can be now be calculated from an expression + new action addition: url that solery calculate the expanded url
This commit is contained in:
parent
14c66ae4d7
commit
0cc66841c2
|
@ -8,7 +8,8 @@ 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
|
||||
hash^VITA3KSHAPLACEHOLDER^https://github.com/Vita3K/Vita3K/releases/download/continuous/ubuntu-latest.zip
|
||||
hash^RANIGHTLYCORESPLACEHOLDER^https://buildbot.libretro.com/nightly/linux/x86_64/RetroArch_cores.7z
|
||||
#hash^RETRODECKMAMEPLACEHOLDER^
|
||||
hash^RETRODECKMAMEPLACEHOLDER^https://github.com/XargonWan/RetroDECK-MAME/archive/refs/tags/$(curl -s https://api.github.com/repos/XargonWan/RetroDECK-MAME/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')-Artifact.tar.gz
|
||||
url^RETRODECKMAMEPLACEHOLDERURL^https://github.com/XargonWan/RetroDECK-MAME/archive/refs/tags/$(curl -s https://api.github.com/repos/XargonWan/RetroDECK-MAME/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')-Artifact.tar.gz
|
||||
latestcommit^UNIVERSALDYNAMICINPUTCOMMITPLACEHOLDER^https://github.com/Venomalia/UniversalDynamicInput^main
|
||||
outside_info^VERSIONPLACEHOLDER^${GITHUB_WORKSPACE}/buildid
|
||||
branch^THISBRANCH
|
||||
|
|
|
@ -44,9 +44,10 @@ do
|
|||
elif [[ "$action" == "hash" ]]; then
|
||||
echo
|
||||
echo "Placeholder text: $placeholder"
|
||||
echo "URL to hash: $url"
|
||||
calculated_url=$(eval echo "$url") # in case the url has to be calculated from an expression
|
||||
echo "URL to hash: $calculated_url"
|
||||
echo
|
||||
hash=$(curl -sL "$url" | sha256sum | cut -d ' ' -f1)
|
||||
hash=$(curl -sL "$calculated_url" | sha256sum | cut -d ' ' -f1)
|
||||
echo "Hash found: $hash"
|
||||
/bin/sed -i 's^'"$placeholder"'^'"$hash"'^' $rd_manifest
|
||||
elif [[ "$action" == "latestcommit" ]]; then
|
||||
|
@ -77,6 +78,14 @@ do
|
|||
echo "Information being injected: $(cat $url)"
|
||||
echo
|
||||
/bin/sed -i 's^'"$placeholder"'^'"$(cat $url)"'^' $rd_manifest
|
||||
elif [[ "$action" == "url" ]]; then
|
||||
# this is used to calculate a dynamic url
|
||||
echo
|
||||
echo "Placeholder text: $placeholder"
|
||||
calculated_url=$(eval echo "$url")
|
||||
echo "Information being injected: $calculated_url"
|
||||
echo
|
||||
/bin/sed -i 's^'"$placeholder"'^'"$calculated_url"'^' $rd_manifest
|
||||
fi
|
||||
fi
|
||||
done < "$automation_task_list"
|
||||
|
|
Loading…
Reference in a new issue