Releases attach a standalone CLI for linux-aarch64 and linux-x86_64 built natively (package-cli.sh/release-upload.sh, as in Sabiá). ROADMAP drops the reference to the local-only spec and README describes the published image and binaries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
26 lines
985 B
Bash
Executable File
26 lines
985 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Uploads assets to a Gitea release, replacing any existing asset with the same
|
|
# filename so re-running a CI job never fails on duplicate attachments.
|
|
#
|
|
# API=https://git.example.com/api/v1/repos/owner/repo TOKEN=... \
|
|
# scripts/release-upload.sh v1.2.3 file1 file2
|
|
set -euo pipefail
|
|
|
|
: "${API:?set API (Gitea repository API URL)}"
|
|
: "${TOKEN:?set TOKEN}"
|
|
tag=${1:?usage: release-upload.sh <tag> <file>...}
|
|
shift
|
|
|
|
auth=(-H "Authorization: token $TOKEN")
|
|
id=$(curl -fsS "${auth[@]}" "$API/releases/tags/$tag" | jq -r .id)
|
|
|
|
for file in "$@"; do
|
|
name=$(basename "$file")
|
|
encoded=$(jq -rn --arg n "$name" '$n|@uri')
|
|
for old in $(curl -fsS "${auth[@]}" "$API/releases/$id/assets" | jq -r --arg n "$name" '.[] | select(.name == $n) | .id'); do
|
|
curl -fsS -X DELETE "${auth[@]}" "$API/releases/$id/assets/$old"
|
|
done
|
|
curl -fsS -X POST "${auth[@]}" -F "attachment=@$file" "$API/releases/$id/assets?name=$encoded" >/dev/null
|
|
echo "uploaded: $name"
|
|
done
|