Created
July 16, 2021 21:36
-
-
Save graffiti75/cb0e4b701ed4dad4e737738440d5b0c2 to your computer and use it in GitHub Desktop.
Continuous Delivery for Android Using GitHub Actions
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: Deploy to Play Store | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Generate Release APK | |
run: ./gradlew assembleRelease | |
- name: Sign APK | |
uses: r0adkll/sign-android-release@v1 | |
# ID used to access action output | |
id: sign_app | |
with: | |
releaseDirectory: app/build/outputs/apk/release | |
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
alias: ${{ secrets.ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
- uses: actions/upload-artifact@master | |
with: | |
name: release.apk | |
path: ${{steps.sign_app.outputs.signedReleaseFile}} | |
- uses: actions/upload-artifact@master | |
with: | |
name: mapping.txt | |
path: app/build/outputs/mapping/release/mapping.txt | |
deploy-play-store: | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
# 1: Downloads the release APK and mapping file using the actions/download-artifact action. | |
- uses: actions/download-artifact@master | |
with: | |
name: release.apk | |
- uses: actions/download-artifact@master | |
with: | |
name: mapping.txt | |
# 2: Uploads the APK to the internal track and makes it available to 50% percent of the users on that track. | |
- name: Publish to Play Store internal test track | |
uses: r0adkll/upload-google-play@v1 | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} | |
# 3: Specifies the package name of the app and also the APK and mapping file to upload. | |
packageName: br.android.cericatto.rwquotes | |
releaseFile: app-release-unsigned-signed.apk | |
track: internal | |
userFraction: 0.50 | |
mappingFile: mapping.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment