Skip to content

Commit

Permalink
ci: add a circleci job to push the release build to playstore interna…
Browse files Browse the repository at this point in the history
…l release
  • Loading branch information
superus8r committed Mar 30, 2024
1 parent 98fffc2 commit 5dd82dd
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
16 changes: 16 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,22 @@ jobs:
path: /home/circleci/project/app/build/outputs/apk/debug/app-debug.apk
destination: fastlane-output-debug

distribute-internal-testing:
executor: android-docker
resource_class: large
steps:
- checkout
- restore_gradle_cache
- run:
name: Prepare Fastlane
command: sudo bundle update
- run:
name: Distribute to Firebase AppTester
command: bundle exec fastlane deploy
- store_artifacts:
path: /home/circleci/project/app/build/outputs/bundle/release/app-release.aab
destination: fastlane-output-release

workflows:
workflow:
jobs:
Expand Down
12 changes: 12 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,18 @@ tasks.register("generateAppDistKey") {
}
}

tasks.register("generateInternalReleaseKey") {
doLast {
val jsonFileName = "internal-release-key.json"
val fileContent = System.getenv("SERVICE_ACCOUNT_USB_TERMINAL_PLAY_STORE_RAW")
File(rootDir, jsonFileName).apply {
createNewFile()
writeText(fileContent)
println("generated ${this.path}")
}
}
}

fun loadKeyStore(name: String): Properties? {
val ksProp = Properties()
val ksPropFile = file(name)
Expand Down
10 changes: 6 additions & 4 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ platform :android do

desc "Deploy a new version to the Google Play"
lane :deploy do
gradle(
task: 'bundle',
build_type: 'Release'
)
gradle(tasks: [
"generateKsPropFile",
"generateGoogleServicesJson",
"generateInternalReleaseKey",
"bundleRelease"
])
upload_to_play_store(
track: 'internal',
release_status: 'draft',
Expand Down

0 comments on commit 5dd82dd

Please sign in to comment.