Version 40 (3.5.2) #29
Workflow file for this run
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: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Create properties file with keys | |
env: | |
KEYS_PROPERTIES: ${{ secrets.KEYS_PROPERTIES }} | |
run: | | |
echo "$KEYS_PROPERTIES" > keys.properties | |
- name: set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
# Cache Gradle dependencies and Gradle Wrapper | |
- name: Setup Gradle Cache | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }} | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Run Unit tests | |
run: ./gradlew :app:testDebugUnitTest | |
- name: Build debug APK | |
run: ./gradlew :app:assembleDebug | |
- name: Build androidTest APK | |
run: ./gradlew :app:assembleAndroidTest | |
- name: Run Android Tests on Firebase Test Lab (API 24) | |
uses: asadmansr/[email protected] | |
with: | |
arg-spec: 'android-device.yml:nexus6-api-24' | |
env: | |
SERVICE_ACCOUNT: ${{ secrets.SERVICE_ACCOUNT_JSON }} | |
- name: Run Android Tests on Firebase Test Lab (API 33) | |
uses: asadmansr/[email protected] | |
with: | |
arg-spec: 'android-device.yml:pixel6-api-33' | |
env: | |
SERVICE_ACCOUNT: ${{ secrets.SERVICE_ACCOUNT_JSON }} | |
- name: Build release APK | |
if: success() | |
run: ./gradlew :app:assembleRelease | |
- name: Setup build tool version variable | |
shell: bash | |
run: | | |
BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1) | |
echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV | |
echo Last build tool version is: $BUILD_TOOL_VERSION | |
- name: Sign release APK | |
if: success() | |
uses: r0adkll/sign-android-release@v1 | |
id: sign_apk | |
with: | |
releaseDirectory: app/build/outputs/apk/release | |
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
alias: ${{ secrets.KEY_ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
env: | |
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }} | |
- name: Build release AAB | |
if: success() | |
run: ./gradlew :app:bundleRelease | |
- name: Sign release AAB | |
if: success() | |
uses: r0adkll/sign-android-release@v1 | |
id: sign_aab | |
with: | |
releaseDirectory: app/build/outputs/bundle/release | |
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
alias: ${{ secrets.KEY_ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
env: | |
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }} | |
- name: Create CHANGELOG | |
id: changelog | |
uses: oleksandrvolovik/changelog-action@v1 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
tag: ${{ github.ref_name }} | |
writeToFile: false | |
googlePlayMode: false | |
- name: Create release | |
if: success() | |
id: create_release | |
uses: actions/create-release@v1 | |
with: | |
release_name: Release ${{ github.ref_name }} | |
tag_name: ${{ github.ref_name }} | |
body: ${{ steps.changelog.outputs.changes }} | |
draft: false | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
- name: Upload release APK | |
if: success() | |
id: upload_release_asset | |
uses: actions/[email protected] | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{ steps.sign_apk.outputs.signedReleaseFile }} | |
asset_name: release.apk | |
asset_content_type: application/zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
- name: Create release notes for Google Play | |
id: release_notes | |
uses: oleksandrvolovik/changelog-action@v1 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
tag: ${{ github.ref_name }} | |
writeToFile: false | |
excludeTypes: perf,refactor,test,build,doc,style,chore,other | |
googlePlayMode: true | |
- name: Write release notes to file | |
env: | |
RELEASE_NOTES: ${{ steps.release_notes.outputs.changes }} | |
run: | | |
echo "Release notes" > whatsnew-en-US | |
- name: Upload release AAB to Google Play | |
if: success() | |
uses: r0adkll/upload-google-play@v1 | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} | |
packageName: volovyk.guerrillamail | |
track: production | |
releaseFiles: ${{ steps.sign_aab.outputs.signedReleaseFile }} | |
whatsNewDirectory: . |