diff --git a/scripts/publish-rpm.sh b/scripts/publish-rpm.sh index 2be80f4..ba6ca9f 100755 --- a/scripts/publish-rpm.sh +++ b/scripts/publish-rpm.sh @@ -12,6 +12,7 @@ fi GITEA_URL="${GITEA_URL:-http://10.0.0.194:3012}" GITEA_OWNER="${GITEA_OWNER:-michal}" +GITEA_REPO="${GITEA_REPO:-mcpctl}" if [ -z "$GITEA_TOKEN" ]; then echo "Error: GITEA_TOKEN not set. Add it to .env or export it." @@ -49,7 +50,22 @@ curl --fail -s -X PUT \ echo "" echo "==> Published successfully!" + +# Verify the package is linked to the repo (Gitea stores the link at package level) +REPO_LINK=$(curl -s -H "Authorization: token ${GITEA_TOKEN}" \ + "${GITEA_URL}/api/v1/packages/${GITEA_OWNER}/rpm/mcpctl/${RPM_VERSION}" \ + | python3 -c "import json,sys; d=json.load(sys.stdin); r=d.get('repository'); print(r.get('full_name') if r else '')" 2>/dev/null) + +if [ -n "$REPO_LINK" ]; then + echo "==> Linked to repo: ${REPO_LINK}" +else + echo "" + echo "WARNING: Package is not linked to a repository." + echo "Link it manually in the Gitea UI:" + echo " ${GITEA_URL}/${GITEA_OWNER}/-/packages/rpm/mcpctl/${RPM_VERSION}/settings" + echo " → Link to repository: ${GITEA_OWNER}/${GITEA_REPO}" +fi + echo "" echo "Install with:" -echo " sudo dnf config-manager --add-repo ${GITEA_URL}/api/packages/${GITEA_OWNER}/rpm.repo" -echo " sudo dnf install mcpctl" +echo " sudo dnf install mcpctl # if repo already configured"