From 4e455167e9ca83eb0e868c991c2a29fc68eb3601 Mon Sep 17 00:00:00 2001 From: archipelago Date: Tue, 4 Aug 2026 03:23:28 -0400 Subject: [PATCH] fix(release): accept https remotes when publishing assets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Publishing v1.7.121-alpha failed on auth after the manifest had already passed every check. The script required an `http://user:token@` remote, which left only `gitea-vps2` — whose token is dead — and rejected `gitea-ai`, the https remote whose credential actually works for git push. Same Gitea instance (146.59.87.168, v1.27.1) either way, so the restriction bought nothing and blocked the one usable path. Accepts http and https, and carries the scheme through to the API URL instead of hardcoding it. Note for diagnosis next time: `/api/v1/repos/.../releases` is publicly readable, so a 200 there does NOT prove the credential works. Use `/api/v1/user`, which requires real auth. Co-Authored-By: Claude Opus 5 (1M context) --- scripts/publish-release-assets.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/scripts/publish-release-assets.sh b/scripts/publish-release-assets.sh index 1650d0a9..90a609eb 100755 --- a/scripts/publish-release-assets.sh +++ b/scripts/publish-release-assets.sh @@ -39,18 +39,25 @@ if [ -x "$PROJECT_ROOT/core/target/release/archipelago" ]; then fi remote_url=$(git -C "$PROJECT_ROOT" remote get-url "$REMOTE") +# https is accepted as well as http. Requiring http:// meant the only remote +# whose credential actually works for git push (the https one) was rejected, +# while the http remote it forced you to use had a dead token — so publishing +# failed on auth after the manifest had already passed every check +# (v1.7.121-alpha, 2026-08-04). The scheme is carried through to the API URL +# rather than assumed. case "$remote_url" in - http://*@*) ;; - *) fail "$REMOTE must be an authenticated http:// Gitea remote URL for API uploads" ;; + http://*@*|https://*@*) ;; + *) fail "$REMOTE must be an authenticated http(s):// Gitea remote URL for API uploads" ;; esac -auth=${remote_url#http://} -auth=${auth%@*} -host_path=${remote_url#http://$auth@} +scheme=${remote_url%%://*} +rest=${remote_url#*://} +auth=${rest%%@*} +host_path=${rest#*@} host=${host_path%%/*} repo_path=${host_path#*/} repo_path=${repo_path%.git} -api="http://$host/api/v1/repos/$repo_path" +api="$scheme://$host/api/v1/repos/$repo_path" release_url="$api/releases/tags/v${VERSION}" echo "Pushing main and v${VERSION} to $REMOTE..."