CI / Guthub actions v2 #25
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Build | |
on: | |
workflow_dispatch: | |
inputs: | |
name: | |
description: "Release-Build" | |
default: "Generate release build" | |
pull_request: | |
branches: [ '*' ] # run on all pull requests | |
jobs: | |
build: | |
runs-on: macos-latest # use [ self-hosted, macOS ] to host on our own mac mini, which is twice as fast and cheaper than hosting on a github runner. See README for more info. | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Prepare build | |
uses: ./.github/workflows/scripts/prepare | |
- name: Update Version Code # we increase the version code with each build | |
uses: chkfung/android-version-actions@v1.1 | |
with: | |
gradlePath: app/build.gradle | |
versionCode: ${{ github.run_number }} | |
# 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 >upload-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: Upload Release APK to Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ github.run_number }}_apk_debug | |
path: | | |
${{ github.workspace }}/app/build/outputs/apk/release/app-release.apk | |
- 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: Upload Release Bundle to Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ github.run_number }}_apk_debug | |
path: | | |
${{ github.workspace }}/app/build/outputs/bundle/release/app-release.aab |