From 35981bcc8238ea8d481479bd1b77ee4f3c7efc6e Mon Sep 17 00:00:00 2001 From: Krakinou Date: Sat, 17 Dec 2022 14:01:25 +0100 Subject: [PATCH 1/4] change assets path to zipball_url --- .github/workflows/updater.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index 05f52a9..87c0b0c 100755 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -9,7 +9,7 @@ current_version=$(cat manifest.json | jq -j '.version|split("~")[0]') repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]') # Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions) version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1) -assets=($(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '[ .[] | select(.tag_name=="'$version'").assets[].browser_download_url ] | join(" ") | @sh' | tr -d "'")) +assets=($(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '[ .[] | select(.tag_name=="'$version'").zipball_url ] | join(" ") | @sh' | tr -d "'")) # Later down the script, we assume the version has only digits and dots # Sometimes the release name starts with a "v", so let's filter it out. From 3e40d55c4ccc3d1ffbdf8f52ccd41a40a0921de1 Mon Sep 17 00:00:00 2001 From: Krakinou Date: Sat, 17 Dec 2022 14:14:08 +0100 Subject: [PATCH 2/4] handle zipball assets --- .github/workflows/updater.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index 87c0b0c..633b91b 100755 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -53,14 +53,16 @@ echo "Handling asset at $asset_url" # Assign the asset to a source file in conf/ directory # Leave $src empty to ignore the asset -case $asset_url in - *"Source"*) - src="app" - ;; - *) - src="" - ;; -esac +#case $asset_url in +# *"Source"*) +# src="app" +# ;; +# *) +# src="" +# ;; +#esac +#There should be only one asset in the zipball directory +src="app" # If $src is not empty, let's process the asset if [ ! -z "$src" ]; then From d6bc23e67ae4e0e10df8c5e5b760b8d8a25c21e2 Mon Sep 17 00:00:00 2001 From: Krakinou Date: Sat, 17 Dec 2022 14:21:12 +0100 Subject: [PATCH 3/4] handle app.src update --- .github/workflows/updater.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index 633b91b..5a74ea3 100755 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -61,9 +61,9 @@ echo "Handling asset at $asset_url" # src="" # ;; #esac -#There should be only one asset in the zipball directory +#There should be only one asset in the zipball directory and it is a zip file src="app" - +extension="zip" # If $src is not empty, let's process the asset if [ ! -z "$src" ]; then @@ -79,20 +79,20 @@ checksum=$(sha256sum "$tempdir/$filename" | head -c 64) rm -rf $tempdir # Get extension -if [[ $filename == *.tar.gz ]]; then - extension=tar.gz -else - extension=${filename##*.} -fi +#if [[ $filename == *.tar.gz ]]; then +# extension=tar.gz +#else +# extension=${filename##*.} +#fi # Rewrite source file cat < conf/$src.src -SOURCE_URL=$asset_url +SOURCE_URL=$asset_url.$extension SOURCE_SUM=$checksum SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=$extension SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= +SOURCE_EXTRACT=true EOT echo "... conf/$src.src updated" From 598aed6b215c00c1669fac5852b5be5ff434257a Mon Sep 17 00:00:00 2001 From: Krakinou Date: Sat, 17 Dec 2022 18:11:42 +0100 Subject: [PATCH 4/4] remove zip extension --- .github/workflows/updater.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index 5a74ea3..9bf8d2e 100755 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -87,7 +87,7 @@ rm -rf $tempdir # Rewrite source file cat < conf/$src.src -SOURCE_URL=$asset_url.$extension +SOURCE_URL=$asset_url SOURCE_SUM=$checksum SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=$extension