Fix package registry: use correct DELETE endpoint for generic packages
All checks were successful
Release / build-and-release (push) Successful in 26m43s
All checks were successful
Release / build-and-release (push) Successful in 26m43s
Forgejo generic package API uses /api/packages/ not /api/v1/packages/ for both upload and deletion. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
c777dbb7b8
commit
4030cc90b2
1 changed files with 9 additions and 8 deletions
|
|
@ -209,23 +209,24 @@ jobs:
|
|||
env:
|
||||
FORGEJO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
PKG_API="${GITHUB_SERVER_URL}/api/v1/packages/${GITHUB_REPOSITORY_OWNER}/generic/simpl-resultat/latest"
|
||||
UPLOAD_URL="${GITHUB_SERVER_URL}/api/packages/${GITHUB_REPOSITORY_OWNER}/generic/simpl-resultat/latest"
|
||||
PKG_URL="${GITHUB_SERVER_URL}/api/packages/${GITHUB_REPOSITORY_OWNER}/generic/simpl-resultat/latest"
|
||||
|
||||
# Delete the old package version via API v1 to avoid 409 conflicts
|
||||
# Delete the old package version to avoid 409 conflicts
|
||||
echo "Deleting old package version (if any)..."
|
||||
curl -s -X DELETE \
|
||||
"${PKG_API}" \
|
||||
-H "Authorization: token ${FORGEJO_TOKEN}" || true
|
||||
DEL_CODE=$(curl -s -w "%{http_code}" -X DELETE \
|
||||
"${PKG_URL}" \
|
||||
-H "Authorization: token ${FORGEJO_TOKEN}" \
|
||||
-o /tmp/del_response.json)
|
||||
echo "Delete HTTP $DEL_CODE"
|
||||
|
||||
echo "Uploading latest.json to package registry..."
|
||||
HTTP_CODE=$(curl -w "%{http_code}" -X PUT \
|
||||
"${UPLOAD_URL}/latest.json" \
|
||||
"${PKG_URL}/latest.json" \
|
||||
-H "Authorization: token ${FORGEJO_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
--data-binary "@release-assets/latest.json" \
|
||||
-o /tmp/pkg_response.json)
|
||||
echo "HTTP $HTTP_CODE"
|
||||
echo "Upload HTTP $HTTP_CODE"
|
||||
if [ "$HTTP_CODE" != "201" ]; then
|
||||
echo "Upload response:"
|
||||
cat /tmp/pkg_response.json
|
||||
|
|
|
|||
Loading…
Reference in a new issue