From 287542fd3d08b7339b52311e7baaf1db5d1d942a Mon Sep 17 00:00:00 2001 From: Bhaskar Date: Tue, 4 Mar 2025 23:30:05 +0530 Subject: [PATCH] feat: add GitHub Actions workflow for building and releasing APK --- .github/workflows/build-release.yaml | 53 ++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/build-release.yaml diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml new file mode 100644 index 0000000..d976872 --- /dev/null +++ b/.github/workflows/build-release.yaml @@ -0,0 +1,53 @@ +name: Build and Release APK + +on: + push: + branches: + - develop + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: '3.27.3' + cache: true + + - name: Install Dependencies + run: flutter pub get + + - name: Build APK + run: flutter build apk --release + + - name: Upload APK to Artifacts + uses: actions/upload-artifact@v4 + with: + name: release-apk + path: build/app/outputs/flutter-apk/app-release.apk + + release: + needs: build + runs-on: ubuntu-latest + + steps: + - name: Download apk + uses: actions/download-artifact@v4 + with: + name: release-apk + path: build/ + + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + tag_name: v1.${{ github.run_number }} + name: Release v1.${{ github.run_number }} + body: "New Android APK release." + files: build/app-release.apk + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}