diff --git a/.github/workflows/build-apk.yml b/.github/workflows/build-apk.yml new file mode 100644 index 0000000..69e4840 --- /dev/null +++ b/.github/workflows/build-apk.yml @@ -0,0 +1,61 @@ +# Construit l'APK release et publie une GitHub Release à chaque mise à jour +# de main (nouvelle version de l'app). Sur une pull request ou un lancement +# manuel (workflow_dispatch), l'APK est seulement construit et déposé en +# artifact — aucune release n'est publiée. +name: Build APK + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +permissions: + contents: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '17' + + - uses: subosito/flutter-action@v2 + with: + channel: stable + flutter-version: 3.35.3 + cache: true + + - name: Read app version from pubspec.yaml + id: version + run: echo "version=$(grep '^version:' pubspec.yaml | awk '{print $2}' | cut -d+ -f1)" >> "$GITHUB_OUTPUT" + + - run: flutter pub get + + - name: Build release APK + run: flutter build apk --release + + - name: Rename APK with version + run: cp build/app/outputs/flutter-apk/app-release.apk "xtremobile-v${{ steps.version.outputs.version }}.apk" + + - name: Upload APK artifact + uses: actions/upload-artifact@v4 + with: + name: xtremobile-v${{ steps.version.outputs.version }}-apk + path: xtremobile-v${{ steps.version.outputs.version }}.apk + + # La release n'est créée que sur main : un même numéro de version met à + # jour la release existante au lieu d'en créer une seconde. + - name: Publish GitHub Release + if: github.ref == 'refs/heads/main' + uses: softprops/action-gh-release@v2 + with: + tag_name: v${{ steps.version.outputs.version }} + name: XtremMobile v${{ steps.version.outputs.version }} + files: xtremobile-v${{ steps.version.outputs.version }}.apk + generate_release_notes: true diff --git a/pubspec.yaml b/pubspec.yaml index 73b8730..e78e466 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: xtremobile description: High-performance IPTV Android Application with Xtream Codes API publish_to: 'none' -version: 1.6.1+13 +version: 1.7.0+14 environment: sdk: '>=3.0.0 <4.0.0'