ci: substituir upload-artifact por release Gitea (fix ECONNREFUSED 127.0.1.1:443)
Build AAB — WhatSMS Gateway / build (push) Successful in 4m33s

This commit is contained in:
2026-04-24 16:57:29 +00:00
parent fa6f7e0a21
commit 1cb31d1615
+28 -6
View File
@@ -40,9 +40,31 @@ jobs:
chmod +x gradlew chmod +x gradlew
./gradlew bundleRelease --no-daemon --stacktrace ./gradlew bundleRelease --no-daemon --stacktrace
- name: Upload AAB - name: Publicar AAB como release Gitea
uses: actions/upload-artifact@v3 env:
with: GITEA_TOKEN: ${{ github.token }}
name: whatsms-gateway-v3.2.0-release-aab run: |
path: app/build/outputs/bundle/release/*.aab AAB=$(find app/build/outputs/bundle/release -name "*.aab" | head -1)
retention-days: 30 echo "AAB encontrado: $AAB"
# Criar release (ignora erro se tag ja existir)
RESP=$(curl -s -X POST \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
https://git.descomplicar.pt/api/v1/repos/ealmeida/whatsms-gateway-android/releases \
-d '{"tag_name":"v3.2.0-ci","name":"WhatSMS Gateway v3.2.0 CI","body":"Build automatico Gitea Actions","draft":false,"prerelease":true}')
RELEASE_ID=$(echo "$RESP" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
# Se release ja existe, obter ID por tag
if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" = "null" ]; then
RELEASE_ID=$(curl -s \
-H "Authorization: token $GITEA_TOKEN" \
https://git.descomplicar.pt/api/v1/repos/ealmeida/whatsms-gateway-android/releases/tags/v3.2.0-ci \
| grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
fi
echo "Release ID: $RELEASE_ID"
# Upload AAB como asset da release
curl -s -X POST \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary "@$AAB" \
"https://git.descomplicar.pt/api/v1/repos/ealmeida/whatsms-gateway-android/releases/${RELEASE_ID}/assets?name=whatsms-gateway-v3.2.0.aab"
echo "Upload concluido!"