ci: substituir upload-artifact por release Gitea (fix ECONNREFUSED 127.0.1.1:443)
Build AAB — WhatSMS Gateway / build (push) Successful in 4m33s
Build AAB — WhatSMS Gateway / build (push) Successful in 4m33s
This commit is contained in:
@@ -40,9 +40,31 @@ jobs:
|
||||
chmod +x gradlew
|
||||
./gradlew bundleRelease --no-daemon --stacktrace
|
||||
|
||||
- name: Upload AAB
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: whatsms-gateway-v3.2.0-release-aab
|
||||
path: app/build/outputs/bundle/release/*.aab
|
||||
retention-days: 30
|
||||
- name: Publicar AAB como release Gitea
|
||||
env:
|
||||
GITEA_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
AAB=$(find app/build/outputs/bundle/release -name "*.aab" | head -1)
|
||||
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!"
|
||||
|
||||
Reference in New Issue
Block a user