From 50a03e6c9d8a8d634a4c49a7002b8fff3c7a85fb Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Wed, 26 Jun 2024 09:13:36 +0200 Subject: [PATCH] Fixed URL encoding accordingly to GitHub (#11) --- .github/workflows/build-and-release.yml | 18 +++++------------- metadata.txt | 2 +- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 0a08b6d..fb9b79d 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -662,18 +662,6 @@ jobs: # Here, we create the JSON object: platforms_json=$(jq -n '{}') - # Define the urlencode function: - urlencode() { - local length="${#1}" - for (( i = 0; i < length; i++ )); do - local c="${1:i:1}" - case $c in - [a-zA-Z0-9.~_-]) printf "$c" ;; - *) printf '%%%02X' "'$c" ;; - esac - done - } - # Display the structure of the release directory: ls -Rlhat $GITHUB_WORKSPACE/release/assets @@ -713,7 +701,11 @@ jobs: # Extract the artifact name and create the URL: artifact_name=$(basename "$sig_file" .sig) - encoded_artifact_name=$(urlencode "$artifact_name") + + # Replaces spaces by '.': + encoded_artifact_name=$(echo "$artifact_name" | sed 's/ /./g') + + # Create the URL: url="https://github.com/MindWorkAI/AI-Studio/releases/download/$FORMATTED_VERSION/$encoded_artifact_name" # Build the JSON object: diff --git a/metadata.txt b/metadata.txt index df27472..3f294ab 100644 --- a/metadata.txt +++ b/metadata.txt @@ -6,4 +6,4 @@ 1.79.0 (commit 129f3b996) 6.20.0 1.6.1 -2818aa93411, dev debug +2818aa93411, release