From 5d21a4e99a01a5826910c65df4144f45fef74079 Mon Sep 17 00:00:00 2001 From: Augsorn Chanklad Date: Sat, 9 Dec 2023 17:17:43 +0700 Subject: [PATCH] Handle versioning and fastlane in workflow --- .github/workflows/test.yaml | 21 ++++++++++++++++++++- android/fastlane/Fastfile | 4 ++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d6a7ba96..fac5ad19 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,6 +16,10 @@ jobs: - name: Print architecture run: uname -m + + - name: Get current version + id: increment-version + run: echo "::set-output name=version::$(($BASE_VERSION_CODE + 1))" - name: Setup Flutter uses: subosito/flutter-action@v2 @@ -45,4 +49,19 @@ jobs: echo "storeFile=./vocadb-release-key.keystore" >> ./android/key.properties - name: Build appbundle - run: flutter build appbundle --no-tree-shake-icons \ No newline at end of file + run: flutter build appbundle --build-number=${{ steps.increment-version.outputs.version }} --no-tree-shake-icons + + + - name: Download google-play-service-account.json + run: | + echo "${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}" > ./android/fastlane/google-play-service-account.json + ls ./android/fastlane -l + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.0' + bundler-cache: true + - uses: maierj/fastlane-action@v3.0.0 + with: + lane: 'internal' + options: '{ "version_code": ${{ steps.increment-version.outputs.version }} }' \ No newline at end of file diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index 1b72204e..0cd8bae6 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -31,10 +31,10 @@ platform :android do end desc "Deploy a new version to the Google Play as Internal track" - lane :internal do + lane :internal do |options| # https://docs.fastlane.tools/actions/upload_to_play_store/ upload_to_play_store(track: "internal", - version_code:102439, + version_code:options[:version_code], aab: "../build/app/outputs/bundle/release/app-release.aab") end