From a821c98d982bde8a42a2b10cb0a520671f272dab Mon Sep 17 00:00:00 2001 From: icenine451 Date: Thu, 6 Jun 2024 09:18:57 -0400 Subject: [PATCH 1/2] Add "latestghtag" option to pre-build automation. - Also correct some text in the "latestghrelease" option --- automation_tools/pre_build_automation.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/automation_tools/pre_build_automation.sh b/automation_tools/pre_build_automation.sh index 895f2074..96ca9836 100755 --- a/automation_tools/pre_build_automation.sh +++ b/automation_tools/pre_build_automation.sh @@ -8,6 +8,8 @@ # Needs the URL of the file, in this line format: hash^PLACEHOLDERTEXT^url # latestcommit: Finds the most recent commit of a git repo and updated the placeholder in the manifest. # Needs the URL of the repo and the branch to find the latest commit from, in this line format: latestcommit^PLACEHOLDERTEXT^url^branch +# latestghtag: Finds the most recent tag on a GitHub repo, for repos that don't have normal releases, but also shouldn't use the latest commit +# Needs the URL of the repo, in this line format: latestghtag^PLACEHOLDERTEXT^url # latestghrelease: Finds the download URL and SHA256 hash of the latest release from a git repo. # Needs the API URL of the repo, in this line format: latestappimage^PLACEHOLDERTEXT^https://api.github.com/repos///releases/latest^ # As this command updates two different placeholders (one for the URL, one for the file hash) in the manifest, @@ -82,10 +84,19 @@ do /bin/sed -i 's^'"$placeholder"'^'"$commit"'^' $rd_manifest ;; + "latestghtag" ) + echo + echo "Placeholder text: $placeholder" + echo "Repo to get the latest tag from: $url" + echo + tag=$(git ls-remote "$url" | tail -n 1 | cut -f2 | sed 's|refs/tags/||') + echo "Tag found: $tag" + /bin/sed -i 's^'"$placeholder"'^'"$tag"'^' $rd_manifest + "latestghrelease" ) echo echo "Placeholder text: $placeholder" - echo "Repo to look for AppImage releases: $url" + echo "Repo to look for latest releases: $url" echo ghreleaseurl=$(curl -s "$url" | grep browser_download_url | grep "$branch\""$ | cut -d : -f 2,3 | tr -d \" | sed -n 1p | tr -d ' ') echo "GitHub release URL found: $ghreleaseurl" From 9942837d82c1cd4ffef4b3a34d86906607fcff3e Mon Sep 17 00:00:00 2001 From: icenine451 Date: Thu, 6 Jun 2024 09:19:46 -0400 Subject: [PATCH 2/2] Add missing case end. --- automation_tools/pre_build_automation.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/automation_tools/pre_build_automation.sh b/automation_tools/pre_build_automation.sh index 96ca9836..476ae315 100755 --- a/automation_tools/pre_build_automation.sh +++ b/automation_tools/pre_build_automation.sh @@ -92,6 +92,7 @@ do tag=$(git ls-remote "$url" | tail -n 1 | cut -f2 | sed 's|refs/tags/||') echo "Tag found: $tag" /bin/sed -i 's^'"$placeholder"'^'"$tag"'^' $rd_manifest + ;; "latestghrelease" ) echo