Bump Gradle and dependencies version #73
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: Android CI | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build-apk: | |
name: Generate APK | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Decode Keystore File | |
uses: timheuer/base64-to-file@v1 | |
id: android_keystore | |
with: | |
fileName: "jReader_key.jks" | |
encodedString: ${{ secrets.KEYSTORE_FILE }} | |
- name: Setup Properties-file | |
run: | | |
touch secret.properties | |
echo KEYSTORE_FILE=${{ steps.android_keystore.outputs.filePath }} >> secret.properties | |
echo KEYSTORE_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }} >> secret.properties | |
echo KEY_ALIAS=${{ secrets.KEY_ALIAS }} >> secret.properties | |
echo KEY_PASSWORD=${{ secrets.KEY_PASSWORD }} >> secret.properties | |
cat secret.properties | |
- name: Increment build number | |
run: ./gradlew incrementBuildNumber | |
- name: Commit build number change | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "Bump build number [skip ci]" | |
commit_user_name: Alin Babu | |
commit_user_email: alinbabu2010@gmail.com | |
commit_author: Alin Babu <alinbabu2010@gmail.com> | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build APK | |
run: bash ./gradlew assembleRelease --stacktrace | |
- name: Get version name | |
run: | | |
set -e | |
_version=$(grep "versionName " app/build.gradle.kts | awk '{print $3}' | sed 's/"//g' | head -n 1) | |
echo "VERSION_NAME=$_version" >> $GITHUB_ENV | |
- name: Upload to Firebase App Distribution | |
uses: wzieba/Firebase-Distribution-Github-Action@v1.5.0 | |
with: | |
appId: ${{secrets.FIREBASE_APP_ID_ANDROID}} | |
serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }} | |
groups: cicd-test-group | |
file: app/build/outputs/apk/release/jReader_v${{ env.VERSION_NAME }}.apk |