Skip to content

Commit

Permalink
feat: create android-deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
easyhz authored Aug 15, 2024
1 parent 971559b commit 70cedaf
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/android-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Android CI/CD

on:
push:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest
env:
LOCAL_PROPERTIES_CONTENTS: ${{ secrets.LOCAL_PROPERTIES_CONTENTS }}

steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Setup Android SDK
uses: android-actions/setup-android@v2

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Create local.properties
run: |
echo "$LOCAL_PROPERTIES_CONTENTS" > local.properties
- name: Build with Gradle
run: ./gradlew build

- name: Build Release AAB
id: buildRelease
run: ./gradlew bundleRelease

- name: Sign AAB
id: sign
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}

- name: Create service_account.json
id: createServiceAccount
run: echo '${{ secrets.SERVICE_ACCOUNT_JSON }}' > service_account.json

- name: Deploy to Play Store (BETA)
id: deploy
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: service_account.json
packageName: com.easyhz.noffice
releaseFile: app/build/outputs/bundle/release/app-release.aab
track: beta
whatsNewDirectory: whatsnew/

0 comments on commit 70cedaf

Please sign in to comment.