Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Android Build and Deploy
name: Android Build and Deploy (Alpha)

env:
# The name of the main module repository
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
run: bundle exec fastlane android test

- name: Build & deploy Android release
run: bundle exec fastlane android deploy
run: bundle exec fastlane android deploy_alpha
env:
STORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS}}
Expand Down
94 changes: 94 additions & 0 deletions .github/workflows/build-upload-android-internal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Android Build and Deploy (Internal)

env:
# The name of the main module repository
main_project_module: app

# The name of the Play Store
playstore_name: Code Wallet

on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master

- name: Setup Java env
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'corretto'
cache: 'gradle'

- name: Setup Ruby env
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.2
bundler-cache: true

- name: Decode Google Services JSON file
uses: timheuer/base64-to-file@v1
id: google_services_json_file
with:
fileName: google-services.json
fileDir: ./app/src
encodedString: ${{ secrets.GOOGLE_SERVICES_JSON }}

- name: Decode Service Account Key JSON file
uses: timheuer/base64-to-file@v1
id: service_account_json_file
with:
fileName: serviceAccount.json
encodedString: ${{ secrets.SERVICE_ACCOUNT_KEY_JSON }}

- name: Decode Upload Key Store file into location 1
uses: timheuer/base64-to-file@v1
with:
fileName: key
fileDir: ./key
encodedString: ${{ secrets.UPLOAD_KEY_STORE }}

- name: Decode Upload Key Store file into location 2
uses: timheuer/base64-to-file@v1
with:
fileName: key
fileDir: ./app/key
encodedString: ${{ secrets.UPLOAD_KEY_STORE }}

- name: Setup BugSnag API Key
run: echo BUGSNAG_API_KEY=\"${{ secrets.BUGSNAG_API_KEY }}\" > ./local.properties

- name: Setup Fingerprint API Key
run: echo FINGERPRINT_API_KEY=${{ secrets.FINGERPRINT_API_KEY }} >> ./local.properties

- name: Setup Google Cloud Project Number
run: echo GOOGLE_CLOUD_PROJECT_NUMBER=${{ secrets.GOOGLE_CLOUD_PROJECT_NUMBER }} >> ./local.properties

- name: Setup Kado API Key
run: echo KADO_API_KEY=\"${{ secrets.KADO_API_KEY }}\" >> ./local.properties

- name: Setup Mixpanel API Key
run: echo MIXPANEL_API_KEY=\"${{ secrets.MIXPANEL_API_KEY }}\" >> ./local.properties

- name: Run tests
run: bundle exec fastlane android test

- name: Build & deploy Android release
run: bundle exec fastlane android deploy_internal
env:
STORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS}}
KEY_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
SERVICE_ACCOUNT_KEY_JSON: ${{ steps.service_account_json_file.outputs.filePath }}

- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: assets
path: |
${{ github.workspace }}/app/build/outputs/bundle/release
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ android {

defaultConfig {
applicationId = Android.namespace
versionCode = 403
versionCode = 404
versionName = "1.1.$versionCode"

minSdk = Android.minSdkVersion
Expand Down
36 changes: 33 additions & 3 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ platform :android do
gradle(task: "test")
end

desc "Build and Deploy a new version to the Google Play"
lane :deploy do
desc "Build and Deploy a new alpha version to the Google Play"
lane :deploy_alpha do
#puts "Patch version for this build will be " + ENV["BUILD_NUMBER"]
gradle(
task: "clean bundle", #"clean app:bundleRelease",
Expand All @@ -41,7 +41,7 @@ platform :android do
)

upload_to_play_store(
track: "internal",
track: "alpha",
aab: Actions.lane_context[SharedValues::GRADLE_AAB_OUTPUT_PATH],
skip_upload_apk: true,
skip_upload_changelogs: true,
Expand All @@ -50,4 +50,34 @@ platform :android do
# mapping: mapping_file_exists() ? Actions.lane_context[SharedValues::GRADLE_MAPPING_TXT_OUTPUT_PATH] : nil
)
end

desc "Build and Deploy a new internal version to the Google Play"
lane :deploy_internal do
#puts "Patch version for this build will be " + ENV["BUILD_NUMBER"]
gradle(
task: "clean bundle", #"clean app:bundleRelease",
build_type: "release",
properties: {
#"versionPatch" => ENV["BUILD_NUMBER"],
"android.injected.signing.store.file" => "key/key",
"android.injected.signing.store.password" => ENV["STORE_PASSWORD"],
"android.injected.signing.key.alias" => ENV["KEY_ALIAS"],
"android.injected.signing.key.password" => ENV["KEY_PASSWORD"]
}
)

validate_play_store_json_key(
json_key: ENV["SERVICE_ACCOUNT_KEY_JSON"]
)

upload_to_play_store(
track: "internal",
aab: Actions.lane_context[SharedValues::GRADLE_AAB_OUTPUT_PATH],
skip_upload_apk: true,
skip_upload_changelogs: true,
skip_upload_images: true,
mapping: Actions.lane_context[SharedValues::GRADLE_MAPPING_TXT_OUTPUT_PATH]
# mapping: mapping_file_exists() ? Actions.lane_context[SharedValues::GRADLE_MAPPING_TXT_OUTPUT_PATH] : nil
)
end
end