chore(gradle): Update dependency io.mockk:mockk to v1.13.16 (#2505) #6340
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: | |
paths: | |
- .github/workflows/android.yaml | |
- app/** | |
tags: | |
- '*' | |
branches: | |
- '*' | |
pull_request: | |
paths: | |
- .github/workflows/android.yaml | |
- app/** | |
defaults: | |
run: | |
working-directory: app | |
jobs: | |
build-android: | |
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 Android SDK | |
uses: android-actions/setup-android@v3 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
# Release | |
- name: Import keystore | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} | |
KEY_PROPERTIES: ${{ secrets.KEY_PROPERTIES }} | |
DECRYPT_SHARED_KEY: ${{ secrets.DECRYPT_SHARED_KEY }} | |
run: | | |
echo "$KEYSTORE_BASE64" > app/keystore.jks.asc | |
gpg -d --passphrase "$DECRYPT_SHARED_KEY" --batch app/keystore.jks.asc >> app/keystore.jks | |
echo "$KEY_PROPERTIES" > key.properties.asc | |
gpg -d --passphrase "$DECRYPT_SHARED_KEY" --batch key.properties.asc >> key.properties | |
- name: Build Release with Gradle | |
if: "startsWith(github.ref, 'refs/tags/')" | |
run: | | |
chmod +x gradlew | |
./gradlew buildRelease | |
# Staging | |
- name: Build Staging with Gradle | |
if: "!startsWith(github.ref, 'refs/tags/')" | |
run: | | |
chmod +x gradlew | |
./gradlew buildStaging | |
test-android: | |
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 Android SDK | |
uses: android-actions/setup-android@v3 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Test with Gradle | |
run: | | |
chmod +x gradlew | |
./gradlew test | |
check-android: | |
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 Android SDK | |
uses: android-actions/setup-android@v3 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Check with Gradle | |
run: | | |
chmod +x gradlew | |
./gradlew app:check | |
package-apk-android: | |
needs: | |
- test-android | |
- build-android | |
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 Android SDK | |
uses: android-actions/setup-android@v3 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
# Release | |
- name: Import keystore | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} | |
KEY_PROPERTIES: ${{ secrets.KEY_PROPERTIES }} | |
DECRYPT_SHARED_KEY: ${{ secrets.DECRYPT_SHARED_KEY }} | |
run: | | |
echo "$KEYSTORE_BASE64" > app/keystore.jks.asc | |
gpg -d --passphrase "$DECRYPT_SHARED_KEY" --batch app/keystore.jks.asc >> app/keystore.jks | |
echo "$KEY_PROPERTIES" > key.properties.asc | |
gpg -d --passphrase "$DECRYPT_SHARED_KEY" --batch key.properties.asc >> key.properties | |
- name: Package Release with Gradle | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
chmod +x gradlew | |
./gradlew assembleRelease | |
- name: Upload Release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: actions/upload-artifact@v4 | |
with: | |
name: app-apk | |
path: app/app/build/outputs/apk/release/app-release.apk | |
# Staging | |
- name: Package Staging with Gradle | |
if: "!startsWith(github.ref, 'refs/tags/')" | |
run: | | |
chmod +x gradlew | |
./gradlew assembleStaging | |
- name: Upload Staging | |
if: "!startsWith(github.ref, 'refs/tags/')" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: app-apk | |
path: app/app/build/outputs/apk/staging/app-staging-unsigned.apk | |
package-aab-android: | |
needs: | |
- test-android | |
- build-android | |
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 Android SDK | |
uses: android-actions/setup-android@v3 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
# Release | |
- name: Import keystore | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} | |
KEY_PROPERTIES: ${{ secrets.KEY_PROPERTIES }} | |
DECRYPT_SHARED_KEY: ${{ secrets.DECRYPT_SHARED_KEY }} | |
run: | | |
echo "$KEYSTORE_BASE64" > app/keystore.jks.asc | |
gpg -d --passphrase "$DECRYPT_SHARED_KEY" --batch app/keystore.jks.asc >> app/keystore.jks | |
echo "$KEY_PROPERTIES" > key.properties.asc | |
gpg -d --passphrase "$DECRYPT_SHARED_KEY" --batch key.properties.asc >> key.properties | |
- name: Bundle Release with Gradle | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
chmod +x gradlew | |
./gradlew app:bundleRelease | |
- name: Upload Release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: actions/upload-artifact@v4 | |
with: | |
name: app-aab | |
path: app/app/build/outputs/bundle/release/app-release.aab | |
# Staging | |
- name: Bundle Staging with Gradle | |
if: "!startsWith(github.ref, 'refs/tags/')" | |
run: | | |
chmod +x gradlew | |
./gradlew app:bundleStaging | |
- name: Upload Staging | |
if: "!startsWith(github.ref, 'refs/tags/')" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: app-aab | |
path: app/app/build/outputs/bundle/staging/app-staging.aab | |
deploy-android: | |
needs: | |
- test-android | |
- build-android | |
- package-apk-android | |
- package-aab-android | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: app-apk | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: app-aab | |
- name: Release | |
run: | | |
gh release create ${GITHUB_REF#refs/*/} -t ${GITHUB_REF#refs/*/} app-release.apk app-release.aab --generate-notes | |
working-directory: . | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |