fix(ci): use nu http delete/put for generic-packages uploads (yotun pattern) #112
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/generic-packages-use-nu-http"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Reverts #111's
^curl --user "$OWNER:$PAT"shape and switches to nushell's built-inhttp delete/http putwith theAuthorization: token ...bearer header, matchingyotun/.forgejo/workflows/build-desktop-linux.yml. nu 0.112.2 (the version pinned in user CLAUDE.md) ships these out of the box; that path is what every other binary-publishing workflow in the org is converging on, so lets-chat should match. The bearer header IS the right form for this Forgejo's Generic Packages endpoint when sent via the nu http builtins - the earlier 401 from #110 was specific to^curl's header handling in nu, not to the header content.Changes (mirrored across all three files)
.forgejo/workflows/build-desktop-linux.yml.forgejo/workflows/build-desktop-windows.yml.forgejo/workflows/publish-release.ymlFor each:
^curlcalls.http delete --full --allow-errors --headers $auth $url | get statuswith an explicitif $delete_status not-in [204 404] { exit 1 }. Previous "best-effort silent DELETE" swallowed real-error statuses (5xx, 403, etc.) without anyone noticing.http put --content-type application/octet-stream --headers $auth $url (open --raw $src). Failure throws a nu error so the step exits non-zero automatically; no--fail-with-bodyscaffolding needed.let auth = [Authorization $"token ($env.FORGEJO_TOKEN)"]. Revert of the--user/Basic-auth pattern across all three files.url parse | update path ([...] | str join "/") | url joininstead of dense$"..."interpolation. Letsurl joinhandle encoding and keeps path segments listed vertically for review.The job env (
FORGEJO_TOKEN,PACKAGE_OWNER,PACKAGE_NAME) and thepublish-release.ymlupload table (linux binary, windows binary, manifest under${version}/+latest/latest.json) are unchanged.Audit
grep -rn '\^curl\|--user\|Authorization' .forgejo/workflows/after the change:^curlreferences.--userflags.--username/--passwordleft is the^docker logininbuild-oci-image.yml, which is a separate endpoint and has been passing.Test plan
mainpush:build-desktop-linux.ymlandbuild-desktop-windows.ymlcomplete and land${ORG}/generic/lets-chat/latest/lets-chat-desktop-{linux,windows}-x86_64[.exe]in the Generic Packages UI (no 401).204first run,204on re-runs.curl -L "${SERVER}/api/packages/${ORG}/generic/lets-chat/latest/lets-chat-desktop-linux-x86_64" -o /tmp/lcd && file /tmp/lcdshows an ELF binary.v*tag push:publish-release.ymlsucceeds end-to-end includinglatest/latest.json.