Skip to content

feat(CI): create Github workflow #1

feat(CI): create Github workflow

feat(CI): create Github workflow #1

Workflow file for this run

name: CI
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
name: CI
runs-on: ubuntu-latest
steps:
- name: Checking out branch
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'azul'
java-version: 17
- name: Setup Android SDK
uses: android-actions/setup-android@v3
# This will decode the keystore from base 64 text representation that we have stored in secrets
# and generates and keystore file and gets stored in /android-app path
- name: Decode Keystore
env:
ENCODED_STRING: ${{ secrets.KEYSTORE_BASE_64 }}
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }}
RELEASE_KEYSTORE_ALIAS: ${{ secrets.RELEASE_KEYSTORE_ALIAS }}
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
run: |
echo $ENCODED_STRING > keystore-b64.txt
base64 -d keystore-b64.txt > keystore.jks
- name: Build Release apk
env:
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }}
RELEASE_KEYSTORE_ALIAS: ${{ secrets.RELEASE_KEYSTORE_ALIAS }}
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
run: ./gradlew assembleRelease --stacktrace
- name: Build Release bundle
env:
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }}
RELEASE_KEYSTORE_ALIAS: ${{ secrets.RELEASE_KEYSTORE_ALIAS }}
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
run: ./gradlew bundleRelease --stacktrace
- name: Get release file aab path
id: releaseAab
run: echo "aabfile=$(find app/build/outputs/bundle/release/*.aab)" >> $GITHUB_OUTPUT
- name: Get release file apk path
id: releaseApk
run: echo "apkfile=$(find app/build/outputs/apk/release/*.apk)" >> $GITHUB_OUTPUT
- name: Zip Files
uses: papeloto/action-zip@v1
with:
files: ${{ steps.releaseAab.outputs.aabfile }} ${{ steps.releaseApk.outputs.apkfile }}
dest: ${{ steps.releaseApk.outputs.apkfile }}.zip
- name: Upload Release Build to Artifacts
uses: actions/upload-artifact@v3
with:
name: release-artifacts
path: ${{ steps.releaseApk.outputs.apkfile }}