feat(android): prepare auto builds

This commit is contained in:
Johannes Millan 2024-11-06 19:44:05 +01:00
parent da024a1042
commit 9008c22fa6
2 changed files with 29 additions and 0 deletions

View file

@ -7,6 +7,7 @@ on:
workflow_dispatch:
inputs: null
# see: https://medium.com/@dcostalloyd90/automating-android-builds-with-github-actions-a-step-by-step-guide-2a02a54f59cd
jobs:
build:
runs-on: ubuntu-latest
@ -40,8 +41,25 @@ jobs:
- name: Install npm Packages
# if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm i
- name: Decode Keystore
env:
ENCODED_STRING: ${{ secrets.DROID_KEYSTORE_BASE_64 }}
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.DROID_KEYSTORE_PASSWORD }}
RELEASE_KEYSTORE_ALIAS: ${{ secrets.DROID_KEYSTORE_ALIAS }}
RELEASE_KEY_PASSWORD: ${{ secrets.DROID_KEY_PASSWORD }}
run: |
echo $ENCODED_STRING > keystore-b64.txt
base64 -d keystore-b64.txt > keystore.jks
- name: Build
run: npm run dist:android:prod
env:
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.DROID_KEYSTORE_PASSWORD }}
RELEASE_KEYSTORE_ALIAS: ${{ secrets.DROID_KEYSTORE_ALIAS }}
RELEASE_KEY_PASSWORD: ${{ secrets.DROID_KEY_PASSWORD }}
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3

View file

@ -46,10 +46,21 @@ android {
buildConfigField "String", key, value.toString()
}
signingConfig signingConfigs.release
minifyEnabled false
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
signingConfigs{
release{
storeFile file("../keystore.jks")
storePassword System.getenv("RELEASE_KEYSTORE_PASSWORD")
keyAlias System.getenv("RELEASE_KEYSTORE_ALIAS")
keyPassword System.getenv("RELEASE_KEY_PASSWORD")
}
}
flavorDimensions "version"
productFlavors {
play {