Skip to content

Merge pull request #75 from omer358/dev #19

Merge pull request #75 from omer358/dev

Merge pull request #75 from omer358/dev #19

name: Android CI
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'zulu'
cache: gradle
- name: Set environment variables
run: |
echo "REMEMBER_ME_KEY_PASSWORD=${{ secrets.REMEMBER_ME_KEY_PASSWORD }}" >> $GITHUB_ENV
echo "REMEMBER_ME_KEYSTORE_PASSWORD=${{ secrets.REMEMBER_ME_KEYSTORE_PASSWORD }}" >> $GITHUB_ENV
echo "REMEMBER_ME_KEYSTORE_ALIAS=${{ secrets.REMEMBER_ME_KEYSTORE_ALIAS }}" >> $GITHUB_ENV
- name: Set GPG_TTY environment variable
run: echo "export GPG_TTY=true" >> $GITHUB_ENV
- name: Decrypt Keystore File
env:
RELEASE_KEYSTORE_PHRASE: ${{ secrets.RELEASE_KEYSTORE_PHRASE }}
RELEASE_KEYSTORE_FILE: ${{ secrets.REMEMBER_RELEASE_KEYSTORE }}
run: |
mkdir keys
echo "$RELEASE_KEYSTORE_FILE" > keys/keystore.jks.asc
echo "$RELEASE_KEYSTORE_PHRASE" > keys/keystore_passphrase.txt
gpg -d --passphrase-file=keys/keystore_passphrase.txt --batch keys/keystore.jks.asc > keys/keystore.jks
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
env:
KEYPASSWORD: ${{ secrets.REMEMBER_ME_KEY_PASSWORD }}
STOREPASSWORD: ${{ secrets.REMEMBER_ME_KEY_STORE_PASSWORD }}
KEYALIAS: ${{ secrets.REMEMBER_ME_KEYSTORE_ALIAS }}
run: ./gradlew build
- name: Build AAB with Gradle
env:
KEYPASSWORD: ${{ secrets.REMEMBER_ME_KEY_PASSWORD }}
STOREPASSWORD: ${{ secrets.REMEMBER_ME_KEYSTORE_PASSWORD }}
KEYALIAS: ${{ secrets.REMEMBER_ME_KEYSTORE_ALIAS }}
run: ./gradlew bundleRelease
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build
path: |
app/build/outputs/apk/release/*.apk
app/build/outputs/bundle/release/*.aab