diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 1fbbb19..9374086 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -268,25 +268,40 @@ jobs: echo "✅ APK: builds.freetimelab.es → pluriwave → v${VERSION} → ${APK_NOMBRE}" echo "✅ AAB: builds.freetimelab.es → pluriwave → v${VERSION} → ${AAB_NOMBRE}" + # La publicacion automatica en Google Play es OPCIONAL. + # + # Este paso hacia `exit 1` cuando faltaba el secreto, asi que TODA + # compilacion de PRO terminaba en rojo por una funcion que nunca llego a + # activarse: el secreto no se configuro nunca y las subidas a Play se han + # hecho siempre a mano. Un rojo permanente entrena a ignorar los rojos, y + # entonces el dia que falle algo de verdad tampoco se mira. + # + # Ahora se omite con un aviso. El AAB ya esta compilado, firmado y subido + # a ftl-builds por el paso anterior, asi que no se pierde nada. El dia que + # se configure el secreto, los tres pasos se activan solos. - name: Preparar credenciales de Google Play + id: credenciales_play if: ${{ gitea.ref == 'refs/heads/PRO' }} env: GOOGLE_PLAY_SERVICE_ACCOUNT_JSON: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }} run: | if [ -z "$GOOGLE_PLAY_SERVICE_ACCOUNT_JSON" ]; then - echo "ERROR: falta el secreto GOOGLE_PLAY_SERVICE_ACCOUNT_JSON" - exit 1 + echo "disponible=no" >> "$GITHUB_OUTPUT" + echo "AVISO: falta el secreto GOOGLE_PLAY_SERVICE_ACCOUNT_JSON." + echo "Se omite la publicacion en Google Play; sube el AAB a mano." + exit 0 fi mkdir -p fastlane/credentials printf '%s' "$GOOGLE_PLAY_SERVICE_ACCOUNT_JSON" > fastlane/credentials/google-play-service-account.json + echo "disponible=si" >> "$GITHUB_OUTPUT" - name: Instalar Fastlane - if: ${{ gitea.ref == 'refs/heads/PRO' }} + if: ${{ gitea.ref == 'refs/heads/PRO' && steps.credenciales_play.outputs.disponible == 'si' }} run: | gem list -i fastlane >/dev/null 2>&1 || gem install fastlane --no-document - name: Publicar AAB en Google Play Internal Testing - if: ${{ gitea.ref == 'refs/heads/PRO' }} + if: ${{ gitea.ref == 'refs/heads/PRO' && steps.credenciales_play.outputs.disponible == 'si' }} env: PLAY_JSON_KEY_PATH: fastlane/credentials/google-play-service-account.json PLAY_AAB_PATH: build/app/outputs/bundle/release/app-release.aab @@ -304,8 +319,13 @@ jobs: if [ -z "$BOT_TOKEN" ]; then exit 0; fi if [ "${{ job.status }}" = "success" ]; then MSG="✅ *PluriWave* v${VERSION} · rama ${BRANCH} · ${COMMIT}%0AAPK + AAB generados" - if [ "$BRANCH" = "PRO" ]; then + # Solo se anuncia la subida a Play cuando de verdad ocurrio: el paso + # se omite si falta el secreto, y un aviso que dice "publicado" + # cuando no se publico es peor que no avisar. + if [ "$BRANCH" = "PRO" ] && [ "${{ steps.credenciales_play.outputs.disponible }}" = "si" ]; then MSG="${MSG}%0APublicado en Google Play · Internal Testing" + elif [ "$BRANCH" = "PRO" ]; then + MSG="${MSG}%0AEn builds.freetimelab.es · sube el AAB a Play a mano" else MSG="${MSG}%0APublicado en builds.freetimelab.es" fi