Skip to content

Update hilt to v2.47 #1540

Update hilt to v2.47

Update hilt to v2.47 #1540

Workflow file for this run

name: Android CI
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
jobs:
test:
name: Run unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: gradle-${{ runner.os }}-${{ hashFiles('**.gradle', '**/**.gradle', '**/gradle/wrapper/gradle-wrapper.properties') }}
- name: set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Unit tests
run: bash ./gradlew testDebug --stacktrace
lint:
name: Run lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: gradle-${{ runner.os }}-${{ hashFiles('**.gradle', '**/**.gradle', '**/gradle/wrapper/gradle-wrapper.properties') }}
- name: set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Lint
run: bash ./gradlew lintVitalRelease
build:
name: Generate apk
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: gradle-${{ runner.os }}-${{ hashFiles('**.gradle', '**/**.gradle', '**/gradle/wrapper/gradle-wrapper.properties') }}
- name: set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Build debug apk
run: bash ./gradlew :app:assembleDebug
- name: Upload APK artifact
uses: actions/upload-artifact@v3
with:
name: debug apk
path: ${{ github.workspace }}/app/build/outputs/apk/debug/*.apk
- name: Update debug tag
if: (github.event_name == 'push' && github.ref == 'refs/heads/develop')
uses: richardsimko/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: debug
- name: Update debug release
if: (github.event_name == 'push' && github.ref == 'refs/heads/develop')
uses: meeDamian/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: debug
name: Debug APK
files: ${{ github.workspace }}/app/build/outputs/apk/debug/DankChat-debug.apk
gzip: false
allow_override: true
build-release:
name: Generate signed release apk
runs-on: ubuntu-latest
environment: release
if: (github.event_name == 'push' && github.ref == 'refs/heads/develop')
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: gradle-${{ runner.os }}-${{ hashFiles('**.gradle', '**/**.gradle', '**/gradle/wrapper/gradle-wrapper.properties') }}
- name: set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Decode Keystore
id: decode_keystore
uses: timheuer/[email protected]
with:
fileName: '/app/keystore/DankChat.jks'
fileDir: ${{ github.workspace }}
encodedString: ${{ secrets.SIGNING_KEY }}
- name: Build signed release apk
run: bash ./gradlew app:assembleRelease
env:
SIGNING_KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
- name: Upload APK artifact
uses: actions/upload-artifact@v3
with:
name: Signed release apk
path: ${{ github.workspace }}/app/build/outputs/apk/release/*.apk
- name: Update release tag
uses: richardsimko/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: release
- name: Update signed release
uses: meeDamian/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: release
name: Signed release APK
files: ${{ github.workspace }}/app/build/outputs/apk/release/*.apk
gzip: false
allow_override: true