Skip to content

Instantly share code, notes, and snippets.

@chepsi
Last active April 26, 2022 11:27
Show Gist options
  • Select an option

  • Save chepsi/da5225f00882648cf8e26cb30d6809b2 to your computer and use it in GitHub Desktop.

Select an option

Save chepsi/da5225f00882648cf8e26cb30d6809b2 to your computer and use it in GitHub Desktop.
Deploy to Playstore
# This workflow deploys to production
name: Deploy to Production
# The workflow is triggered when a push is made to master
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
- name: set up JDK 11
uses: actions/setup-java@v1
with:
distribution: 'adopt'
java-version: '11'
# Fixes Gradlew permission denied.
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Assemble Release Bundle
run: ./gradlew bundleRelease
- name: Bump version
uses: chkfung/[email protected]
with:
gradlePath: app/build.gradle # or app/build.gradle.kts
versionCode: ${{github.run_number}}
versionName: 1.0.0
- name: Sign Release
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.PLAYSTORE_SIGNING_KEY }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
# Deploy to Production.
- name: Deploy to Production
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.PLAYSTORE_SERVICE_ACCOUNT }}
packageName: com.boring.app
releaseFiles: app/build/outputs/bundle/release/app-release.aab
track: production
whatsNewDirectory: whatsnew/
# Send Slack message
- name: Slack Notification
uses: Ilshidur/[email protected]
env:
SLACK_WEBHOOK: ${{ secrets.ANDROID_SLACK_WEBHOOK }}
SLACK_USERNAME: AndroidDeploymentBot
SLACK_CHANNEL: releases
SLACK_AVATAR: sender
with:
args: 'Boring App has just been deployed to production. :confetti_ball:'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment