generated from deepin-community/template-repository-main
This commit is contained in:
26
.github/workflows/main.yml
vendored
26
.github/workflows/main.yml
vendored
@ -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
|
||||
|
Reference in New Issue
Block a user