Fixed workflow build
All checks were successful
/ build (push) Successful in 1m58s

This commit is contained in:
lichenblankie 2026-04-11 05:11:06 +00:00
parent 6ad3ac8743
commit a32840c309

View file

@ -32,26 +32,27 @@ jobs:
chmod +x TinyWeb-linux-x64
ls -la TinyWeb-linux-x64
- name: Create Release
- name: Get Release ID
if: startsWith(github.ref, 'refs/tags/v')
id: release
run: |
TAG="${{ github.ref_name }}"
REPO="${{ github.repository }}"
TOKEN="${{ secrets.FORGEJO_TOKEN }}"
# Try to create release (ignore error if exists)
curl -X POST "https://git.derickphan.com/api/v1/repos/$REPO/releases" \
-H "Authorization: token $TOKEN" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\"}" || true
RELEASE_JSON=$(curl -s "https://git.derickphan.com/api/v1/repos/$REPO/releases/tags/$TAG" \
-H "Authorization: token $TOKEN")
echo "$RELEASE_JSON"
RELEASE_ID=$(echo "$RELEASE_JSON" | jq -r '.id')
echo "release_id=$RELEASE_ID" >> $FORGEJO_OUTPUT
- name: Upload to Release
if: startsWith(github.ref, 'refs/tags/v')
run: |
FILE=TinyWeb-linux-x64
TAG="${{ github.ref_name }}"
RELEASE_ID="${{ steps.release.outputs.release_id }}"
REPO="${{ github.repository }}"
TOKEN="${{ secrets.FORGEJO_TOKEN }}"
curl -X POST "https://git.derickphan.com/api/v1/repos/$REPO/releases/$TAG/assets" \
curl -X POST "https://git.derickphan.com/api/v1/repos/$REPO/releases/$RELEASE_ID/assets" \
-H "Authorization: token $TOKEN" \
-F "attachment=@$FILE"