diff --git a/ci/fix_asset_links.sh b/ci/fix_asset_links.sh new file mode 100755 index 0000000000000000000000000000000000000000..27c5771f9f9f3db543ed496894fd648d9ca748db --- /dev/null +++ b/ci/fix_asset_links.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash + +tag= +token= + +read -sp 'Access Token ' token +echo +read -p 'Release Tag: ' tag + +response=$(curl \ + --request GET \ + --header "PRIVATE-TOKEN: ${token}" \ + "https://git.ps.informatik.uni-kiel.de/api/v4/projects/88/releases/${tag}/assets/links/") + +# get id, name and url for each link and put it into an array +tmp=$(echo "${response}" | jq -r '.[] | .id ') +ids=($tmp) +tmp=$(echo "${response}" | jq -r '.[] | .name ') +names=($tmp) +tmp=$(echo "${response}" | jq -r '.[] | .url ') +old_urls=($tmp) + +# fix each link +for idx in "${!ids[@]}" ; do + + echo + + link_id="${ids[idx]}" + name="${names[idx]}" + old_url="${old_urls[idx]}" + + echo "Fixing Link with ID: ${link_id}" + echo "Corresponding Name: ${name}" + echo "Current URL: ${old_url}" + + unset url + read -p "New URL [Current URL]: " url + url=${url:-${old_url}} + + curl \ + --request PUT \ + --data name="${name}" \ + --data filepath="/other/${name}" \ + --data url="${url}" \ + --header "PRIVATE-TOKEN: ${token}" \ + "https://git.ps.informatik.uni-kiel.de/api/v4/projects/88/releases/${tag}/assets/links/${link_id}" + +done + +echo diff --git a/ci/update_version.sh b/ci/update_version.sh index bfc2eaaa18461a41529321a6cb86579e3a4f0d60..f68bff690623f4586bab91e3e5e4fcc9c69a020f 100755 --- a/ci/update_version.sh +++ b/ci/update_version.sh @@ -80,7 +80,7 @@ function release() { release_helper_init release - DOWNLOAD_URL="https://git.ps.informatik.uni-kiel.de/curry/pakcs/${release}/downloads" + DOWNLOAD_URL="https://git.ps.informatik.uni-kiel.de/curry/pakcs/-/releases/${release_tag}/downloads/other" # replace the latest.version file install -D /dev/stdin "${LATEST_FILE}" <<LATEST_VERSION