feature test
This commit is contained in:
@ -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/
|
||||
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
|
||||
Reference in New Issue
Block a user