Update .gitea/workflows/build-android.yaml
Build Custom Bluesky APK / build-android (push) Failing after 33m42s
Build Custom Bluesky APK / build-android (push) Failing after 33m42s
This commit is contained in:
@@ -119,41 +119,43 @@ jobs:
|
|||||||
GITEA_API: ${{ github.server_url }}/api/v1
|
GITEA_API: ${{ github.server_url }}/api/v1
|
||||||
REPO: ${{ github.repository }}
|
REPO: ${{ github.repository }}
|
||||||
run: |
|
run: |
|
||||||
|
echo "API base: $GITEA_API"
|
||||||
|
echo "Repo: $REPO"
|
||||||
|
|
||||||
TAG="latest"
|
TAG="latest"
|
||||||
|
|
||||||
# Look up any existing "latest" release
|
EXISTING_RELEASE=$(curl -sS -w "\nHTTP_STATUS:%{http_code}" \
|
||||||
EXISTING_RELEASE=$(curl -s \
|
|
||||||
-H "Authorization: token $GITEA_TOKEN" \
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
"$GITEA_API/repos/$REPO/releases/tags/$TAG")
|
"$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]*')
|
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
|
if [ -n "$EXISTING_ID" ]; then
|
||||||
echo "Deleting existing release ID: $EXISTING_ID"
|
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" \
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
"$GITEA_API/repos/$REPO/releases/$EXISTING_ID"
|
"$GITEA_API/repos/$REPO/releases/$EXISTING_ID"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Delete the old tag too, so a fresh one can be created cleanly
|
echo "Deleting old tag..."
|
||||||
curl -s -X DELETE \
|
curl -sS -w "\nHTTP_STATUS:%{http_code}" -X DELETE \
|
||||||
-H "Authorization: token $GITEA_TOKEN" \
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
"$GITEA_API/repos/$REPO/tags/$TAG"
|
"$GITEA_API/repos/$REPO/tags/$TAG"
|
||||||
|
|
||||||
# Create the new rolling release
|
echo "Creating new release..."
|
||||||
RELEASE_RESPONSE=$(curl -s -X POST \
|
RELEASE_RESPONSE=$(curl -sS -w "\nHTTP_STATUS:%{http_code}" -X POST \
|
||||||
-H "Authorization: token $GITEA_TOKEN" \
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"tag_name\": \"$TAG\", \"name\": \"Latest Build\", \"body\": \"Automated build from commit ${{ github.sha }}\", \"draft\": false, \"prerelease\": false}" \
|
-d "{\"tag_name\": \"$TAG\", \"name\": \"Latest Build\", \"body\": \"Automated build from commit ${{ github.sha }}\", \"draft\": false, \"prerelease\": false}" \
|
||||||
"$GITEA_API/repos/$REPO/releases")
|
"$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]*')
|
RELEASE_ID=$(echo "$RELEASE_RESPONSE" | grep -o '"id":[0-9]*' | head -1 | grep -o '[0-9]*')
|
||||||
|
|
||||||
echo "Created release ID: $RELEASE_ID"
|
echo "Created release ID: $RELEASE_ID"
|
||||||
|
|
||||||
# Upload the APK as a release asset
|
echo "Uploading APK..."
|
||||||
curl -s -X POST \
|
curl -sS -w "\nHTTP_STATUS:%{http_code}" -X POST \
|
||||||
-H "Authorization: token $GITEA_TOKEN" \
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
-F "attachment=@bluesky-custom.apk" \
|
-F "attachment=@bluesky-custom.apk" \
|
||||||
"$GITEA_API/repos/$REPO/releases/$RELEASE_ID/assets?name=bluesky-custom.apk"
|
"$GITEA_API/repos/$REPO/releases/$RELEASE_ID/assets?name=bluesky-custom.apk"
|
||||||
Reference in New Issue
Block a user