|
4 | 4 | pull_request: |
5 | 5 | branches: [ develop, main ] |
6 | 6 | push: |
7 | | - branches: [ develop ] |
| 7 | + branches: [ develop, main ] |
8 | 8 |
|
9 | 9 | permissions: |
10 | 10 | contents: read |
|
37 | 37 | - name: Run tests |
38 | 38 | run: flutter test |
39 | 39 |
|
40 | | - # 6️⃣ Reportar fallos a Issues automáticamente |
| 40 | + # 6️⃣ Build APK SOLO en main |
| 41 | + - name: Build APK |
| 42 | + if: github.ref == 'refs/heads/main' |
| 43 | + run: flutter build apk --release |
| 44 | + |
| 45 | + # 7️⃣ Subir APK como artifact SOLO en main |
| 46 | + - name: Upload APK Artifact |
| 47 | + if: github.ref == 'refs/heads/main' |
| 48 | + uses: actions/upload-artifact@v3 |
| 49 | + with: |
| 50 | + name: app-release |
| 51 | + path: build/app/outputs/flutter-apk/app-release.apk |
| 52 | + |
| 53 | + # 8️⃣ Crear Release SOLO en main |
| 54 | + - name: Create GitHub Release |
| 55 | + if: github.ref == 'refs/heads/main' |
| 56 | + uses: softprops/action-gh-release@v1 |
| 57 | + with: |
| 58 | + tag_name: v${{ github.run_number }} |
| 59 | + name: "Build #${{ github.run_number }}" |
| 60 | + files: build/app/outputs/flutter-apk/app-release.apk |
| 61 | + env: |
| 62 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 63 | + |
| 64 | + # 9️⃣ Reportar fallos a Issues automáticamente |
41 | 65 | - name: 🤖 Report Failure to Issues |
42 | 66 | if: failure() |
43 | 67 | env: |
|
81 | 105 | --body "⚠️ **Nueva falla detectada** en el commit \`$SHA\`. Revisa los [nuevos logs aquí]($RUN_URL)." |
82 | 106 | fi |
83 | 107 |
|
84 | | - # 7️⃣ Cerrar issue si todo pasa |
| 108 | + # 🔟 Cerrar issue si todo pasa |
85 | 109 | - name: ✅ Close CI Issue if build succeeds |
86 | 110 | if: success() |
87 | 111 | env: |
|
0 commit comments