.gitea/workflows/build-release.yaml aktualisiert
Android Build & Release / build (push) Has been cancelled

This commit is contained in:
robin committed 2026-07-08 15:16:06 +00:00
1 parent 6483c78504
commit bf0191d843
1 file changed
+23 -11
+23 -11
View File
@@ -33,14 +33,26 @@ jobs:
ALIAS: ${{ secrets.ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
- name: Gitea Release erstellen und APK hochladen
uses: https://github.com/gitea/release-action@main
with:
files: |
app/build/outputs/apk/release/*.apk
name: "Release v-${{ github.sha }}"
tag_name: "v-${{ github.sha }}"
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }}
- name: Gitea Release via API erstellen und APK hochladen
run: |
# 1. Release in Gitea erstellen und die ID abfangen
RELEASE_ID=$(curl -X POST "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases" \
-H "accept: application/json" \
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"v-${{ github.sha }}\",\"target_commitish\":\"main\",\"name\":\"Release v-${{ github.sha }}\",\"body\":\"Automatischer Build\",\"draft\":false,\"prerelease\":false}" \
| grep -oP '"id":\s*\K\d+' | head -n 1)
echo "Release erstellt mit ID: $RELEASE_ID"
# 2. Die gebaute APK an dieses Release anhängen
for apk in app/build/outputs/apk/release/*.apk; do
if [ -f "$apk" ]; then
echo "Lade hoch: $apk"
curl -X POST "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/$RELEASE_ID/assets" \
-H "accept: application/json" \
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
-H "Content-Type: multipart/form-data" \
-F "attachment=@$apk"
fi
done