chore(config): migrate renovate config (#788) #2122
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, develop ] | |
pull_request: | |
branches: [ master, develop ] | |
jobs: | |
test: | |
name: Run unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | |
- name: Unit tests | |
run: bash ./gradlew testDebug --stacktrace | |
lint: | |
name: Run lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | |
- name: Lint | |
run: bash ./gradlew lintVitalRelease | |
build: | |
name: Generate apk | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | |
- name: Build debug apk | |
run: bash ./gradlew :app:assembleDebug | |
- name: Upload APK artifact | |
uses: actions/upload-artifact@v4 | |
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: ncipollo/[email protected] | |
with: | |
tag: debug | |
name: Debug APK | |
artifacts: ${{ github.workspace }}/app/build/outputs/apk/debug/DankChat-debug.apk | |
allowUpdates: 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@v4 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | |
- 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@v4 | |
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: ncipollo/[email protected] | |
with: | |
tag: release | |
name: Signed release APK | |
artifacts: ${{ github.workspace }}/app/build/outputs/apk/release/*.apk | |
allowUpdates: true |