feature test
Some checks failed
Build packages / discover (push) Failing after 2m6s
Build packages / build (push) Has been skipped

This commit is contained in:
paltovkone
2026-03-07 18:32:45 +04:00
commit e922074ba0
10 changed files with 216 additions and 0 deletions

32
scripts/publish.sh Normal file
View File

@ -0,0 +1,32 @@
#!/bin/bash
set -e
DEB=$1
GITEA_URL="https://git.nakolenke.org"
OWNER="nakolenke-pub"
DISTRO="${2:-trixie}"
COMPONENT="${3:-main}"
if [ -z "$DEB" ]; then
echo "Usage: $0 <file.deb> [distro] [component]"
exit 1
fi
if [ -z "$GITEA_TOKEN" ]; then
echo "Error: GITEA_TOKEN not set"
exit 1
fi
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
--user "andrew:${GITEA_TOKEN}" \
--upload-file "$DEB" \
"${GITEA_URL}/api/packages/${OWNER}/debian/pool/${DISTRO}/${COMPONENT}/upload")
echo "HTTP status: $HTTP_CODE"
if [ "$HTTP_CODE" != "201" ]; then
echo "Failed to publish $DEB (HTTP $HTTP_CODE)"
exit 1
fi
echo "Published $DEB${DISTRO}/${COMPONENT}"