Fixed URL encoding accordingly to GitHub (#11)

This commit is contained in:
Thorsten Sommer 2024-06-26 09:13:36 +02:00 committed by GitHub
parent 6170e0ce9a
commit 50a03e6c9d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 14 deletions

View File

@ -662,18 +662,6 @@ jobs:
# Here, we create the JSON object: # Here, we create the JSON object:
platforms_json=$(jq -n '{}') 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: # Display the structure of the release directory:
ls -Rlhat $GITHUB_WORKSPACE/release/assets ls -Rlhat $GITHUB_WORKSPACE/release/assets
@ -713,7 +701,11 @@ jobs:
# Extract the artifact name and create the URL: # Extract the artifact name and create the URL:
artifact_name=$(basename "$sig_file" .sig) 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" url="https://github.com/MindWorkAI/AI-Studio/releases/download/$FORMATTED_VERSION/$encoded_artifact_name"
# Build the JSON object: # Build the JSON object:

View File

@ -6,4 +6,4 @@
1.79.0 (commit 129f3b996) 1.79.0 (commit 129f3b996)
6.20.0 6.20.0
1.6.1 1.6.1
2818aa93411, dev debug 2818aa93411, release