mirror of
https://github.com/wismna/DoNext.git
synced 2025-12-06 00:02:40 -05:00
Use fastlane for deployment
This commit is contained in:
48
.github/workflows/android.yaml
vendored
48
.github/workflows/android.yaml
vendored
@@ -5,11 +5,6 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
pull_request:
|
pull_request:
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
env:
|
|
||||||
MODULE: donextv2
|
|
||||||
BUILD_DIR: donextv2/build/outputs/bundle/release
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -17,7 +12,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up JDK 17
|
- name: Set up JDK 17
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
@@ -39,37 +34,18 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-gradle-
|
${{ runner.os }}-gradle-
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Set up Ruby
|
||||||
run: ./gradlew :${{ env.MODULE }}:testDebugUnitTest --stacktrace
|
uses: ruby/setup-ruby@v1
|
||||||
|
|
||||||
- name: Build AAB
|
|
||||||
run: ./gradlew :${{ env.MODULE }}:bundleRelease
|
|
||||||
|
|
||||||
- name: Upload artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: release-aab
|
ruby-version: 3.1
|
||||||
path: ${{ env.BUILD_DIR }}/*release*.aab
|
|
||||||
|
|
||||||
deploy-google-play:
|
- name: Install Fastlane
|
||||||
needs: build
|
run: gem install fastlane -NV
|
||||||
if: github.event_name == 'workflow_dispatch'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
- name: Configure Google credentials
|
||||||
- name: Download artifact
|
run: echo '${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}' > service-account.json
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: release-aab
|
|
||||||
path: release
|
|
||||||
|
|
||||||
- name: Deploy to Google Play (production)
|
- name: Run Fastlane
|
||||||
uses: r0adkll/upload-google-play@v1
|
env:
|
||||||
with:
|
SUPPLY_JSON_KEY: service-account.json
|
||||||
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}
|
run: fastlane internal
|
||||||
packageName: com.wismna.geoffroy.donext
|
|
||||||
releaseFiles: release/${{ env.MODULE }}-release.aab
|
|
||||||
track: beta
|
|
||||||
metadataRootDirectory: fastlane/metadata/android
|
|
||||||
whatsNewDirectory: fastlane/metadata/android/en-US/changelogs
|
|
||||||
status: completed
|
|
||||||
1
Gemfile
1
Gemfile
@@ -1,3 +1,4 @@
|
|||||||
source "https://rubygems.org"
|
source "https://rubygems.org"
|
||||||
|
|
||||||
gem "fastlane"
|
gem "fastlane"
|
||||||
|
gem 'abbrev'
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
json_key_file("./fastlane/keys/donext-f9e67-5038064982b0")
|
json_key_file(ENV["SUPPLY_JSON_KEY"] || "./fastlane/keys/donext-f9e67-5038064982b0")
|
||||||
package_name("com.wismna.geoffroy.donext")
|
package_name("com.wismna.geoffroy.donext")
|
||||||
|
|||||||
@@ -1,26 +1,23 @@
|
|||||||
default_platform(:android)
|
default_platform(:android)
|
||||||
|
|
||||||
platform :android do
|
platform :android do
|
||||||
desc "Run all unit tests"
|
desc "Build, test, and deploy the production version to Google Play"
|
||||||
lane :test do
|
|
||||||
gradle(task: "testDebugUnitTest")
|
|
||||||
end
|
|
||||||
|
|
||||||
desc "Build a release APK or AAB for beta testing"
|
|
||||||
lane :beta do
|
|
||||||
gradle(task: "clean bundleRelease")
|
|
||||||
upload_to_play_store(
|
|
||||||
track: "beta",
|
|
||||||
aab: "app/build/outputs/bundle/release/app-release.aab"
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
desc "Deploy the production version to Google Play"
|
|
||||||
lane :deploy do
|
lane :deploy do
|
||||||
gradle(task: "clean bundleRelease")
|
gradle(task: "testDebugUnitTest")
|
||||||
|
gradle(task: "clean :donextv2:bundleRelease")
|
||||||
upload_to_play_store(
|
upload_to_play_store(
|
||||||
track: "production",
|
track: "production",
|
||||||
aab: "app/build/outputs/bundle/release/app-release.aab"
|
aab: "donextv2/build/outputs/bundle/release/donextv2-release.aab"
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Build, test, and deploy to Google Play"
|
||||||
|
lane :internal do
|
||||||
|
gradle(task: "testDebugUnitTest")
|
||||||
|
gradle(task: "clean :donextv2:bundleRelease")
|
||||||
|
upload_to_play_store(
|
||||||
|
track: "internal",
|
||||||
|
aab: "donextv2/build/outputs/bundle/release/donextv2-release.aab"
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user