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