Fix/179 workflow #125
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 dev CI | |
on: | |
pull_request: | |
branches: [ "dev" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
LOCAL_PROPERTIES_CONTENTS: ${{ secrets.LOCAL_PROPERTIES_CONTENTS }} | |
KEYSTORE_PROPERTIES_CONTENTS: ${{ secrets.KEYSTORE_PROPERTIES_CONTENTS }} | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }} | |
GOOGLE_SERVICES_JSON_PROD: ${{ secrets.GOOGLE_SERVICES_JSON_PROD }} | |
steps: | |
- uses: actions/checkout@v4 | |
- 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@v2 | |
- name: Cache Gradle packages | |
uses: actions/cache@v3 | |
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: Create google-services.json directory for dev | |
run: mkdir -p app/src/dev | |
- name: Create google-services.json directory for debug | |
run: mkdir -p app/src/debug | |
- name: Create google-services.json for debug | |
run: echo "$GOOGLE_SERVICES_JSON" > app/src/debug/google-services.json | |
- name: Create google-services.json directory for devDebug | |
run: mkdir -p app/src/devDebug | |
- name: Create google-services.json for devDebug | |
run: echo "$GOOGLE_SERVICES_JSON" > app/src/devDebug/google-services.json | |
- name: Decode and create keystore.jks | |
run: echo $SIGNING_KEY | base64 --decode > app/keystore.jks | |
- name: Create local.properties | |
run: | | |
echo "$LOCAL_PROPERTIES_CONTENTS" > local.properties | |
- name: Create keystore.properties | |
run: | | |
echo "$KEYSTORE_PROPERTIES_CONTENTS" > keystore.properties | |
# - name: Build with Gradle | |
# run: ./gradlew build | |
- name: Build debug with Gradle | |
run: ./gradlew assembleDevDebug |