From 32f5bc03b7a896143c4f20380b0e880dd8e438ea Mon Sep 17 00:00:00 2001 From: paltovkone Date: Mon, 9 Mar 2026 23:41:12 +0400 Subject: [PATCH] feature test --- v2ray/scripts/publish.sh | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/v2ray/scripts/publish.sh b/v2ray/scripts/publish.sh index 8a064b2..2cbd5a8 100644 --- a/v2ray/scripts/publish.sh +++ b/v2ray/scripts/publish.sh @@ -5,4 +5,32 @@ mkdir -p out nfpm package --config /pkg/nfpm.yaml --packager deb --target /pkg/out/ echo "✓ built $(ls out/*.deb)" -ls -la out/ \ No newline at end of file +ls -la out/ + + +DEB=$(ls /pkg/out/*.deb | head -1) +FILENAME=$(basename "$DEB") + +DISTRIBUTION="bookworm" +COMPONENT="main" + +echo "↑ publishing ${FILENAME}..." + +HTTP_CODE=$(curl -fsSL \ + -w "%{http_code}" \ + -o /tmp/publish_response.txt \ + -X PUT \ + -H "Authorization: token ${GITEA_TOKEN}" \ + -H "Content-Type: application/octet-stream" \ + --data-binary "@${DEB}" \ + "${GITEA_URL}/api/packages/${GITEA_OWNER}/debian/pool/${DISTRIBUTION}/${COMPONENT}/upload") + +cat /tmp/publish_response.txt +echo "" + +if [[ "$HTTP_CODE" =~ ^2 ]]; then + echo "✓ published ${FILENAME} (HTTP ${HTTP_CODE})" +else + echo "✗ failed (HTTP ${HTTP_CODE})" + exit 1 +fi \ No newline at end of file