ci: replace go-based release-action with scripted gitea release API call (no go on host runner)
This commit is contained in:
@@ -30,8 +30,17 @@ jobs:
|
||||
run: cp app/build/outputs/apk/release/app-release.apk "auxio-${GITHUB_REF_NAME}.apk"
|
||||
|
||||
- name: Create release
|
||||
uses: https://gitea.com/actions/release-action@main
|
||||
with:
|
||||
files: auxio-${{ github.ref_name }}.apk
|
||||
api_key: "${{ secrets.RELEASE_TOKEN }}"
|
||||
title: "Auxio fork ${{ github.ref_name }}"
|
||||
env:
|
||||
TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
run: |
|
||||
API=https://git.wisehodl.dev/api/v1/repos/jay/auxio-fork
|
||||
AUTH="Authorization: token $TOKEN"
|
||||
TAG="${GITHUB_REF_NAME}"
|
||||
REL=$(curl -sf "$API/releases/tags/$TAG" -H "$AUTH") || \
|
||||
REL=$(curl -sf -X POST "$API/releases" -H "$AUTH" -H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\":\"$TAG\",\"name\":\"Auxio fork $TAG\",\"target_commitish\":\"$TAG\"}")
|
||||
RID=$(echo "$REL" | jq -r .id)
|
||||
AID=$(echo "$REL" | jq -r '.assets[]? | select(.name=="auxio-'"$TAG"'.apk") | .id')
|
||||
[ -n "$AID" ] && [ "$AID" != "null" ] && curl -sf -X DELETE "$API/releases/$RID/assets/$AID" -H "$AUTH"
|
||||
curl -sf -X POST "$API/releases/$RID/assets?name=auxio-$TAG.apk" -H "$AUTH" \
|
||||
-F "attachment=@auxio-$TAG.apk" >/dev/null
|
||||
|
||||
Reference in New Issue
Block a user