Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0cfaa50805 | |||
| fea812d3a3 | |||
| fe6e20a68a |
@@ -54,7 +54,7 @@ jobs:
|
|||||||
TAG="${{ github.ref_name }}"
|
TAG="${{ github.ref_name }}"
|
||||||
|
|
||||||
IS_PRERELEASE="false"
|
IS_PRERELEASE="false"
|
||||||
if [[ "$TAG" == *"beta"* ]] || [[ "$TAG" == *"alpha"* ]] || [[ "$TAG" == v0.* ]]; then
|
if [[ "$TAG" =~ beta|alpha|^v0\. ]]; then
|
||||||
IS_PRERELEASE="true"
|
IS_PRERELEASE="true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -87,12 +87,11 @@ jobs:
|
|||||||
-H "Authorization: token $TOKEN" \
|
-H "Authorization: token $TOKEN" \
|
||||||
-F "attachment=@BlackBarRemover_${TAG}_jf12.0.zip"
|
-F "attachment=@BlackBarRemover_${TAG}_jf12.0.zip"
|
||||||
|
|
||||||
- name: Update manifest.json
|
- name: Update manifest.json via API
|
||||||
run: |
|
run: |
|
||||||
git config user.name "Gitea Actions"
|
API_URL="${{ github.api_url }}"
|
||||||
git config user.email "actions@gitea.local"
|
REPO="${{ github.repository }}"
|
||||||
|
TOKEN="${{ github.token }}"
|
||||||
git checkout -B manifest
|
|
||||||
|
|
||||||
VERSION="${{ github.ref_name }}"
|
VERSION="${{ github.ref_name }}"
|
||||||
VERSION="${VERSION#v}"
|
VERSION="${VERSION#v}"
|
||||||
@@ -130,6 +129,20 @@ jobs:
|
|||||||
]
|
]
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
git add manifest.json
|
B64_CONTENT=$(base64 -w0 manifest.json)
|
||||||
git commit -m "Update manifest for ${{ github.ref_name }}"
|
|
||||||
git push -f origin manifest
|
# 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
|
||||||
|
|||||||
Reference in New Issue
Block a user