Skip to content

Flipcash Build and Deploy #195

Flipcash Build and Deploy

Flipcash Build and Deploy #195

name: Flipcash Build and Deploy
env:
# The name of the main module repository
main_project_module: apps:flipcash:app
# The name of the Play Store
playstore_name: Flipcash
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
track:
description: 'Define PlayStore track name'
required: true
default: 'internal'
type: choice
options:
- internal
- alpha
- beta
- production
release_status:
description: 'Status of the release'
required: true
type: choice
default: 'completed'
options:
- completed
- draft
- inProgress
- halted
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- 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: ./apps/flipcash/app/src
encodedString: ${{ secrets.FLIPCASH_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.FLIPCASH_SERVICE_ACCOUNT_KEY_JSON }}
- name: Decode Upload Key Store file into location 1
uses: timheuer/base64-to-file@v1
id: signing_key
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: ./apps/flipcash/app/key
encodedString: ${{ secrets.UPLOAD_KEY_STORE }}
- name: Setup BugSnag API Key
run: echo BUGSNAG_API_KEY=\"${{ secrets.FLIPCASH_BUGSNAG_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 Mixpanel API Key
run: echo MIXPANEL_API_KEY=\"${{ secrets.FLIPCASH_MIXPANEL_API_KEY }}\" >> ./local.properties
- name: Run tests
run: bundle exec fastlane android flipcash_tests
- name: Build & deploy Android release
run: bundle exec fastlane android deploy_flipcash
env:
STORE_FILE: ${{ steps.signing_key.outputs.filePath }}
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 }}
PACKAGE_NAME: com.flipcash.android.app
PLAYSTORE_TRACK: ${{ github.event.inputs.track }}
RELEASE_STATUS: ${{ github.event.inputs.release_status }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: assets
path: |
${{ github.workspace }}/apps/flipcash/app/build/outputs/bundle/release
${{ github.workspace }}/apps/flipcash/app/build/outputs/apk/release