Skip to content

Android Deploy Prod #12

Android Deploy Prod

Android Deploy Prod #12

name: Android Deploy Prod
on:
workflow_dispatch:
jobs:
deploy_prod:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- run: |
echo "${{ secrets.KEYSTORE }}" > keystore.jks.asc
gpg -d --passphrase "${{ secrets.KEYSTORE_PASSPHRASE }}" --batch keystore.jks.asc > keystore.jks
- name: Update Version
run: bash ./.github/scripts/update_versions.sh
- uses: ruby/[email protected]
with:
ruby-version: '2.7.0'
- name: Cache Ruby - Bundler
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Cache Gradle
uses: actions/cache@v1
with:
path: ~/.gradle/caches/
key: cache-clean-gradle-${{ matrix.os }}-${{ matrix.jdk }}
- name: Cache Gradle Wrapper
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper/
key: cache-clean-wrapper-${{ matrix.os }}-${{ matrix.jdk }}
- name: Grant Permission to Execute
run: chmod +x gradlew
- name: Install bundle
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: set up LOCAL_PROPERTIES
env:
LOCAL_PROPERTIES: ${{ secrets.LOCAL_PROPERTIES }}
run: echo "$LOCAL_PROPERTIES" > ./local.properties
- name: Configure Keystore
env:
KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }}
run: |
echo "storeFile=keystore.jks" >> keystore.properties
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> keystore.properties
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> keystore.properties
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> keystore.properties
- name: Create Google Play Config file
env:
PLAY_CONFIG_JSON: ${{ secrets.PLAY_CONFIG_JSON }}
run: |
echo "$PLAY_CONFIG_JSON" > play_config.json.b64
base64 -d -i play_config.json.b64 > play_config.json
- name: Distribute app to Beta track 🚀
run: bundle exec fastlane deploy
- name: Commit files
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -a -m "update version"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PUSH_TOKEN }}
branch: ${{ github.ref }}