Trigger Actions
Some checks failed
Build and Package Golang / build (push) Has been cancelled

This commit is contained in:
2024-12-03 00:26:05 +08:00
parent c0aba8a276
commit 30e7f916d0

View File

@ -63,10 +63,30 @@ jobs:
with:
name: golang-package
path: golang_1.22.6-1_amd64.deb
- name: Upload Debian Package to Gitea
run: |
curl -X PUT \
PACKAGE_FILE="golang_1.22.6-1_amd64.deb"
OWNER="deepin-community"
GITEA_API_URL="https://headscale.mm.md/api/packages/${OWNER}/debian/golang"
if [ ! -f "$PACKAGE_FILE" ]; then
echo "Error: Package file $PACKAGE_FILE not found."
exit 1
fi
echo "Uploading $PACKAGE_FILE to Gitea..."
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -X PUT \
-H "Authorization: token ${{ secrets.GITEA2_TOKEN }}" \
-H "Content-Type: application/vnd.debian.binary-package" \
--data-binary @golang_1.22.6-1_amd64.deb \
http://100.115.108.29:3000/api/packages/deepin-community/debian/golang
--data-binary @"$PACKAGE_FILE" \
"$GITEA_API_URL")
if [ "$RESPONSE" -eq 201 ]; then
echo "Package uploaded successfully!"
else
echo "Error: Failed to upload package. HTTP response code: $RESPONSE"
exit 1
fi