From eae02be45ad571f0813eeece003e1c05f3cc799d Mon Sep 17 00:00:00 2001 From: Kamil Gurgul Date: Wed, 15 Apr 2026 07:22:47 +0200 Subject: [PATCH] [ANDROID] Add auto upload to play store --- .github/workflows/android_release.yml | 22 ++++++++++++++++++++++ .github/workflows/wear_release.yml | 18 ++++++++++++++++++ fastlane/Fastfile | 19 +++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 fastlane/Fastfile diff --git a/.github/workflows/android_release.yml b/.github/workflows/android_release.yml index 663f4676..71c94cbc 100644 --- a/.github/workflows/android_release.yml +++ b/.github/workflows/android_release.yml @@ -114,6 +114,28 @@ jobs: name: mapping-${{ matrix.format.type }} path: androidApp/build/outputs/mapping/ + - name: Set up Ruby + if: matrix.format.type == 'aab' + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' + + - name: Install fastlane + if: matrix.format.type == 'aab' + run: gem install fastlane -NV + + - name: Write Play Store service account JSON + if: matrix.format.type == 'aab' + env: + GOOGLE_SERVICE_ACCOUNT_JSON: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_JSON }} + run: echo "$GOOGLE_SERVICE_ACCOUNT_JSON" > play-service-account.json + + - name: Upload AAB to Play Store internal track + if: matrix.format.type == 'aab' + run: | + AAB_PATH=$(ls androidApp/build/outputs/bundle/release/*.aab | head -n 1) + fastlane android internal aab:"$AAB_PATH" json_key:play-service-account.json + release: needs: build permissions: diff --git a/.github/workflows/wear_release.yml b/.github/workflows/wear_release.yml index 5b6381ca..cfeb5064 100644 --- a/.github/workflows/wear_release.yml +++ b/.github/workflows/wear_release.yml @@ -76,6 +76,24 @@ jobs: with: name: 'mapping-${{ matrix.format.type }}' path: wearOsApp/build/outputs/mapping/ + - name: Set up Ruby + if: matrix.format.type == 'aab' + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' + - name: Install fastlane + if: matrix.format.type == 'aab' + run: gem install fastlane -NV + - name: Write Play Store service account JSON + if: matrix.format.type == 'aab' + env: + GOOGLE_SERVICE_ACCOUNT_JSON: '${{ secrets.GOOGLE_SERVICE_ACCOUNT_JSON }}' + run: echo "$GOOGLE_SERVICE_ACCOUNT_JSON" > play-service-account.json + - name: Upload AAB to Play Store internal track + if: matrix.format.type == 'aab' + run: | + AAB_PATH=$(ls wearOsApp/build/outputs/bundle/release/*.aab | head -n 1) + fastlane android internal aab:"$AAB_PATH" json_key:play-service-account.json release: needs: build permissions: diff --git a/fastlane/Fastfile b/fastlane/Fastfile new file mode 100644 index 00000000..e1662af3 --- /dev/null +++ b/fastlane/Fastfile @@ -0,0 +1,19 @@ +default_platform(:android) + +platform :android do + desc "Upload AAB to Google Play internal testing track" + lane :internal do |options| + upload_to_play_store( + track: 'internal', + aab: options[:aab], + package_name: 'com.kgurgul.cpuinfo', + json_key: options[:json_key], + skip_upload_apk: true, + skip_upload_metadata: true, + skip_upload_changelogs: true, + skip_upload_images: true, + skip_upload_screenshots: true, + release_status: 'draft' + ) + end +end \ No newline at end of file