Android Deploy #42
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 Deploy | |
on: | |
workflow_dispatch: | |
jobs: | |
android-build: | |
name: Android Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set NodeJS version | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Check out Git repository | |
uses: actions/checkout@v3 | |
- name: Set up our JDK environment | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt-hotspot' | |
java-version: '11' | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- name: Restore node_modules from cache | |
uses: actions/cache@v3 | |
id: yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Cache Gradle Wrapper | |
uses: actions/cache@v3 | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | |
- name: Cache Gradle Dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle-caches- | |
- name: 'Create env file' | |
run: | | |
touch .env | |
echo ANDROID_SAFETY_NET_API_KEY=${{ secrets.ANDROID_SAFETY_NET_API_KEY }} >> .env | |
- name: Make Gradlew Executable | |
run: cd android && chmod +x ./gradlew | |
- name: Build Android App Bundle | |
run: | | |
cd android && ./gradlew bundleRelease --no-daemon | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
ANDROID_SAFETY_NET_API_KEY: ${{ secrets.ANDROID_SAFETY_NET_API_KEY }} | |
- name: Sign App Bundle | |
id: sign_app | |
uses: r0adkll/sign-android-release@v1 | |
with: | |
releaseDirectory: android/app/build/outputs/bundle/prodRelease | |
signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} | |
alias: ${{ secrets.ANDROID_ALIAS }} | |
keyStorePassword: ${{ secrets.ANDROID_KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }} | |
- name: Upload App to Google Play | |
uses: r0adkll/upload-google-play@v1 | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.ANDROID_SERVICE_ACCOUNT_JSON_TEXT }} | |
packageName: io.cozy.flagship.mobile | |
releaseFiles: android/app/build/outputs/bundle/prodRelease/*.aab | |
track: internal | |
status: completed |