build(ci): improve android build release upload reliability

- Add explicit contents: write permission for GITHUB_TOKEN
- Increase wait time for release creation from 15 to 20 minutes
- Add failure check if release is not found after waiting
This commit is contained in:
Johannes Millan 2026-01-10 12:54:13 +01:00
parent 6dcede853f
commit e0031b1378

View file

@ -7,6 +7,9 @@ on:
workflow_dispatch:
inputs: {}
permissions:
contents: write
jobs:
build-android:
runs-on: ubuntu-latest
@ -83,14 +86,20 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v')
run: |
echo "Waiting for main release to be created..."
for i in {1..30}; do
for i in {1..40}; do
if gh release view ${{ github.ref_name }} --repo ${{ github.repository }} >/dev/null 2>&1; then
echo "Release found!"
break
fi
echo "Waiting for release... (attempt $i/30)"
echo "Waiting for release... (attempt $i/40)"
sleep 30
done
# Fail if release still doesn't exist
if ! gh release view ${{ github.ref_name }} --repo ${{ github.repository }} >/dev/null 2>&1; then
echo "ERROR: Release ${{ github.ref_name }} was not created after 20 minutes"
exit 1
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}