Create App Release through Github Action workflow #20
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 CD Pipeline | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
build: | ||
name: Deploy Android App | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set Up JDK 18 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '18' | ||
distribution: 'temurin' | ||
cache: gradle | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Bump version code | ||
uses: chkfung/android-version-actions@v1.2 | ||
with: | ||
gradlePath: app/build.gradle.kts | ||
versionCode: ${{github.run_number}} | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Build Release AAB | ||
id: buildRelease | ||
run: ./gradlew bundleRelease | ||
- name: Generate Signed 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: Deploy to Play Store | ||
# id: deploy | ||
# uses: r0adkll/upload-google-play@v1.1.1 | ||
# with: | ||
# serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} | ||
# packageName: com.devx.jetjoke | ||
# releaseFiles: app/build/outputs/bundle/release/app-release.aab | ||
# track: production | ||
# status: completed | ||
# inAppUpdatePriority: 2 | ||
- name: Upload Release Build | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: release-artifacts | ||
paths: | | ||
# app/build/outputs/apk/release/ | ||
app/build/outputs/bundle/release/ | ||
- name: Create Github Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
generate_release_notes: true | ||
prerelease: false | ||
files: | | ||
# app/build/outputs/apk/release/app-release.apk | ||
app/build/outputs/bundle/release/app-release.aab |