From 870cd8a00db5b6c9ba94d669c5e814e3cca46f8c Mon Sep 17 00:00:00 2001 From: Gringo Date: Tue, 10 Mar 2026 17:12:51 +0100 Subject: [PATCH] feat: add automated GitHub release on tag push --- .github/workflows/android.yml | 65 ----------------------------------- .github/workflows/release.yml | 51 +++++++++++++++++++++++++++ pubspec.lock | 8 ++--- 3 files changed, 55 insertions(+), 69 deletions(-) delete mode 100644 .github/workflows/android.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml deleted file mode 100644 index 4a4c5a8..0000000 --- a/.github/workflows/android.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Android Build - -on: - push: - branches: [main] - paths-ignore: - - '**.md' - pull_request: - branches: [main] - workflow_dispatch: - -concurrency: - group: "android-${{ github.ref }}" - cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' - - - name: Setup Flutter - uses: subosito/flutter-action@v2 - with: - channel: stable - cache: true - - - name: Install dependencies - run: flutter pub get - - - name: Install SDK dependencies - run: cd packages/file_transfer_sdk && flutter pub get - - - name: Enable Android platform - run: flutter config --enable-android - - - name: Analyze code - run: flutter analyze - - - name: Build Android APK - run: flutter build apk --release - - - name: Build Android App Bundle - run: flutter build appbundle --release - - - name: Upload APK artifact - uses: actions/upload-artifact@v4 - with: - name: apk-release - path: build/app/outputs/flutter-apk/app-release.apk - retention-days: 30 - - - name: Upload App Bundle artifact - uses: actions/upload-artifact@v4 - with: - name: appbundle-release - path: build/app/outputs/bundle/release/app-release.aab - retention-days: 30 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..380305f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,51 @@ +name: Create Release + +on: + push: + tags: + - 'v*' + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + channel: 'stable' + cache: true + + - name: Get dependencies + run: flutter pub get + + - name: Build APK + run: flutter build apk --release + + - name: Get version from pubspec.yaml + id: version + run: | + VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //') + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: Create Release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.ref_name }} + name: Release v${{ steps.version.outputs.version }} + generate_release_notes: true + draft: false + prerelease: false + files: build/app/outputs/flutter-apk/app-release.apk + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/pubspec.lock b/pubspec.lock index 61f3aac..7a554f4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -424,10 +424,10 @@ packages: dependency: transitive description: name: matcher - sha256: "12956d0ad8390bbcc63ca2e1469c0619946ccb52809807067a7020d57e647aa6" + sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 url: "https://pub.dev" source: hosted - version: "0.12.18" + version: "0.12.19" material_color_utilities: dependency: transitive description: @@ -685,10 +685,10 @@ packages: dependency: transitive description: name: test_api - sha256: "93167629bfc610f71560ab9312acdda4959de4df6fac7492c89ff0d3886f6636" + sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a" url: "https://pub.dev" source: hosted - version: "0.7.9" + version: "0.7.10" toastification: dependency: "direct main" description: