Merge pull request #41 from Zenxlk/fix/lobby-silent-ws-error #35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| concurrency: | |
| # No cancel-in-progress: nunca queremos abortar un build de release a | |
| # medias porque llegó un push nuevo. | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| build_android: | |
| name: Build Android artifacts | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Java | |
| uses: actions/setup-java@v5.6.0 | |
| with: | |
| java-version: '17' | |
| distribution: temurin | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.44.4' | |
| channel: stable | |
| cache: true | |
| - name: Install dependencies | |
| run: flutter pub get | |
| # Mismo motivo que en ci.yml: .env es un asset declarado y no | |
| # versionado. Placeholder vacío a propósito — cablear credenciales | |
| # reales de Supabase acá (vía secrets) es un paso aparte, todavía no | |
| # hecho; hasta entonces los builds de release quedan en modo invitado, | |
| # igual que hoy. | |
| - name: Create placeholder .env | |
| run: cp .env.example .env | |
| - name: Build APK (debug) | |
| run: flutter build apk --debug | |
| - name: Build APK (release) | |
| # Mismo caso que el AppBundle de abajo: sin keystore propio, firma | |
| # con las claves de debug. Instalable igual (sideload), y a | |
| # diferencia del debug build no lleva el banner de debug ni el | |
| # overhead de JIT/assertions — es el que se comparte para probar. | |
| run: flutter build apk --release | |
| - name: Build AppBundle (release) | |
| # Sin keystore de release configurado (android/key.properties), esto | |
| # firma con las claves de debug — el .aab se genera igual mediante | |
| # el pipeline, pero no es publicable en Play Store hasta que se añada | |
| # la firma real (ver ROADMAP.md, Fase 6). | |
| run: flutter build appbundle --release | |
| - name: Upload debug APK | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: apk-debug-${{ github.sha }} | |
| path: build/app/outputs/flutter-apk/app-debug.apk | |
| retention-days: 14 | |
| - name: Upload release APK | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: apk-release-${{ github.sha }} | |
| path: build/app/outputs/flutter-apk/app-release.apk | |
| retention-days: 30 | |
| - name: Upload release AppBundle | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: appbundle-release-${{ github.sha }} | |
| path: build/app/outputs/bundle/release/app-release.aab | |
| retention-days: 30 | |
| publish_github_release: | |
| name: Publish GitHub Release | |
| runs-on: ubuntu-latest | |
| needs: build_android | |
| # Solo en tags v* — un push a main sin tag se queda en los artifacts de | |
| # arriba (build_android), no genera una Release pública. | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download debug APK artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: apk-debug-${{ github.sha }} | |
| path: dist | |
| - name: Download release APK artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: apk-release-${{ github.sha }} | |
| path: dist | |
| - name: Download release AppBundle artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: appbundle-release-${{ github.sha }} | |
| path: dist | |
| - name: Rename artifacts for the release | |
| run: | | |
| mv dist/app-debug.apk "dist/exploding-kittens-${{ github.ref_name }}-debug.apk" | |
| mv dist/app-release.apk "dist/exploding-kittens-${{ github.ref_name }}-release.apk" | |
| mv dist/app-release.aab "dist/exploding-kittens-${{ github.ref_name }}.aab" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| # Los dos .apk son instalables directo (sideload) — firmados con | |
| # las claves de debug hasta que exista firma de release real (ver | |
| # comentario del job de arriba). El .aab queda también por si se | |
| # necesita para Play Store más adelante. | |
| files: | | |
| dist/exploding-kittens-${{ github.ref_name }}-debug.apk | |
| dist/exploding-kittens-${{ github.ref_name }}-release.apk | |
| dist/exploding-kittens-${{ github.ref_name }}.aab | |
| generate_release_notes: true | |
| # Publicación en Google Play Internal Testing track. Deshabilitado hasta | |
| # que exista firma de release real y el secret PLAY_STORE_SERVICE_ACCOUNT_JSON | |
| # (cuenta de servicio con permiso de "Release manager" en Play Console). | |
| # Descomentar cuando esa parte de Fase 6 esté lista. | |
| # | |
| # publish_play_store: | |
| # name: Publish to Google Play (internal track) | |
| # runs-on: ubuntu-latest | |
| # needs: build_android | |
| # if: startsWith(github.ref, 'refs/tags/v') | |
| # steps: | |
| # - name: Download AppBundle artifact | |
| # uses: actions/download-artifact@v8 | |
| # with: | |
| # name: appbundle-release-${{ github.sha }} | |
| # | |
| # - name: Upload to Play Store | |
| # uses: r0adkll/upload-google-play@v1 | |
| # with: | |
| # serviceAccountJsonPlainText: ${{ secrets.PLAY_STORE_SERVICE_ACCOUNT_JSON }} | |
| # packageName: com.zenxlk.exploding_kittens | |
| # releaseFiles: app-release.aab | |
| # track: internal |