diff --git a/.gitea/workflows/build-android.yaml b/.gitea/workflows/build-android.yaml index 8116b359c8..eaee998efb 100644 --- a/.gitea/workflows/build-android.yaml +++ b/.gitea/workflows/build-android.yaml @@ -119,41 +119,43 @@ jobs: GITEA_API: ${{ github.server_url }}/api/v1 REPO: ${{ github.repository }} run: | + echo "API base: $GITEA_API" + echo "Repo: $REPO" + TAG="latest" - # Look up any existing "latest" release - EXISTING_RELEASE=$(curl -s \ + EXISTING_RELEASE=$(curl -sS -w "\nHTTP_STATUS:%{http_code}" \ -H "Authorization: token $GITEA_TOKEN" \ "$GITEA_API/repos/$REPO/releases/tags/$TAG") + echo "Existing release lookup response: $EXISTING_RELEASE" EXISTING_ID=$(echo "$EXISTING_RELEASE" | grep -o '"id":[0-9]*' | head -1 | grep -o '[0-9]*') - # If it exists, delete the release itself if [ -n "$EXISTING_ID" ]; then echo "Deleting existing release ID: $EXISTING_ID" - curl -s -X DELETE \ + curl -sS -w "\nHTTP_STATUS:%{http_code}" -X DELETE \ -H "Authorization: token $GITEA_TOKEN" \ "$GITEA_API/repos/$REPO/releases/$EXISTING_ID" fi - # Delete the old tag too, so a fresh one can be created cleanly - curl -s -X DELETE \ + echo "Deleting old tag..." + curl -sS -w "\nHTTP_STATUS:%{http_code}" -X DELETE \ -H "Authorization: token $GITEA_TOKEN" \ "$GITEA_API/repos/$REPO/tags/$TAG" - # Create the new rolling release - RELEASE_RESPONSE=$(curl -s -X POST \ + echo "Creating new release..." + RELEASE_RESPONSE=$(curl -sS -w "\nHTTP_STATUS:%{http_code}" -X POST \ -H "Authorization: token $GITEA_TOKEN" \ -H "Content-Type: application/json" \ -d "{\"tag_name\": \"$TAG\", \"name\": \"Latest Build\", \"body\": \"Automated build from commit ${{ github.sha }}\", \"draft\": false, \"prerelease\": false}" \ "$GITEA_API/repos/$REPO/releases") + echo "Create release response: $RELEASE_RESPONSE" RELEASE_ID=$(echo "$RELEASE_RESPONSE" | grep -o '"id":[0-9]*' | head -1 | grep -o '[0-9]*') - echo "Created release ID: $RELEASE_ID" - # Upload the APK as a release asset - curl -s -X POST \ + echo "Uploading APK..." + curl -sS -w "\nHTTP_STATUS:%{http_code}" -X POST \ -H "Authorization: token $GITEA_TOKEN" \ -F "attachment=@bluesky-custom.apk" \ "$GITEA_API/repos/$REPO/releases/$RELEASE_ID/assets?name=bluesky-custom.apk" \ No newline at end of file