Merge pull request #88 from eshc123/dev #11
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 CD | |
on: | |
push: | |
branches: | |
- release | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: Android CI/CD | |
steps: | |
- uses: actions/checkout@v3 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v3 | |
- name: Cache Gradle packages | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Access BASE_URL | |
env: | |
GNR_BASE_URL: ${{ secrets.GNR_BASE_URL }} | |
run: echo GNR_BASE_URL=\"$GNR_BASE_URL\" > ./local.properties | |
- name: Generate Debug Keystore file from Github Secrets | |
run: | | |
mkdir ./app/keystore | |
echo "$KEYSTORE" > ./app/keystore/debug_keystore.b64 | |
base64 -d -i ./app/keystore/debug_keystore.b64 > ./app/keystore/debug.keystore | |
env: | |
KEYSTORE: ${{ secrets.DEBUG_KEYSTORE_BASE64 }} | |
- name: Build with Gradle | |
run: ./gradlew assembleDebug | |
- name: Send APK to Slack | |
uses: MeilCli/slack-upload-file@v1 | |
with: | |
slack_token: ${{ secrets.SLACK_BOT_TOKEN }} | |
file_path: ./app/build/outputs/apk/debug/app-debug.apk | |
channels: release-android | |
file_name: debug_apk.apk | |
file_type: apk | |
initial_comment: ${{ github.event.head_commit.message }} |