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"
|
run: cp app/build/outputs/apk/release/app-release.apk "auxio-${GITHUB_REF_NAME}.apk"
|
||||||
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
uses: https://gitea.com/actions/release-action@main
|
env:
|
||||||
with:
|
TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
files: auxio-${{ github.ref_name }}.apk
|
run: |
|
||||||
api_key: "${{ secrets.RELEASE_TOKEN }}"
|
API=https://git.wisehodl.dev/api/v1/repos/jay/auxio-fork
|
||||||
title: "Auxio fork ${{ github.ref_name }}"
|
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