Compare commits

...

4 Commits

Author SHA1 Message Date
karol 0cfaa50805 fix: update manifest on master branch via Gitea API
Build and Release Plugin / release (push) Failing after 33s
2026-09-17 21:17:44 +02:00
karol fea812d3a3 fix: update manifest via Gitea API in release workflow
Build and Release Plugin / release (push) Failing after 32s
2026-09-17 21:15:28 +02:00
karol fe6e20a68a fix: use authenticated git push URL in release workflow
Build and Release Plugin / release (push) Failing after 33s
2026-09-17 21:12:40 +02:00
karol b7693b606e fix: replace release assets cleanly in Gitea Action
Build and Release Plugin / release (push) Failing after 34s
2026-09-17 21:09:12 +02:00
+32 -11
View File
@@ -54,7 +54,7 @@ jobs:
TAG="${{ github.ref_name }}"
IS_PRERELEASE="false"
if [[ "$TAG" == *"beta"* ]] || [[ "$TAG" == *"alpha"* ]] || [[ "$TAG" == v0.* ]]; then
if [[ "$TAG" =~ beta|alpha|^v0\. ]]; then
IS_PRERELEASE="true"
fi
@@ -70,21 +70,28 @@ jobs:
REL_ID=$(echo "$RELEASE_RES" | grep -o '"id":[0-9]*' | head -1 | cut -d':' -f2)
fi
# Delete existing assets for this release if present
ASSETS=$(curl -s -H "Authorization: token $TOKEN" "$API_URL/repos/$REPO/releases/$REL_ID/assets")
echo "$ASSETS" | grep -o '"id":[0-9]*' | cut -d':' -f2 | while read -r asset_id; do
if [ -n "$asset_id" ]; then
curl -s -X DELETE -H "Authorization: token $TOKEN" "$API_URL/repos/$REPO/releases/$REL_ID/assets/$asset_id"
fi
done
# Upload Assets
curl -s -X POST "$API_URL/repos/$REPO/releases/$REL_ID/assets" \
-H "Authorization: token $TOKEN" \
-F "attachment=@BlackBarRemover_${TAG}_jf10.11.zip" || true
-F "attachment=@BlackBarRemover_${TAG}_jf10.11.zip"
curl -s -X POST "$API_URL/repos/$REPO/releases/$REL_ID/assets" \
-H "Authorization: token $TOKEN" \
-F "attachment=@BlackBarRemover_${TAG}_jf12.0.zip" || true
-F "attachment=@BlackBarRemover_${TAG}_jf12.0.zip"
- name: Update manifest.json
- name: Update manifest.json via API
run: |
git config user.name "Gitea Actions"
git config user.email "actions@gitea.local"
git checkout -B manifest
API_URL="${{ github.api_url }}"
REPO="${{ github.repository }}"
TOKEN="${{ github.token }}"
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#v}"
@@ -122,6 +129,20 @@ jobs:
]
EOF
git add manifest.json
git commit -m "Update manifest for ${{ github.ref_name }}"
git push -f origin manifest
B64_CONTENT=$(base64 -w0 manifest.json)
# Update on master branch
EXISTING_MANIFEST=$(curl -s -H "Authorization: token $TOKEN" "$API_URL/repos/$REPO/contents/manifest.json?ref=master")
FILE_SHA=$(echo "$EXISTING_MANIFEST" | grep -o '"sha":"[^"]*"' | head -1 | cut -d'"' -f4)
if [ -n "$FILE_SHA" ]; then
curl -s -X PUT "$API_URL/repos/$REPO/contents/manifest.json" \
-H "Authorization: token $TOKEN" \
-H "Content-Type: application/json" \
-d "{\"content\":\"$B64_CONTENT\", \"message\":\"Update manifest.json for ${{ github.ref_name }}\", \"sha\":\"$FILE_SHA\", \"branch\":\"master\"}"
else
curl -s -X PUT "$API_URL/repos/$REPO/contents/manifest.json" \
-H "Authorization: token $TOKEN" \
-H "Content-Type: application/json" \
-d "{\"content\":\"$B64_CONTENT\", \"message\":\"Create manifest.json for ${{ github.ref_name }}\", \"branch\":\"master\"}"
fi