Skip to content

Merge pull request #158 from cuappdev/justin/playstore-publish #6

Merge pull request #158 from cuappdev/justin/playstore-publish

Merge pull request #158 from cuappdev/justin/playstore-publish #6

name: Publish to Google Play Store Beta
on:
push:
branches: [ prod-beta ]
jobs:
build:
runs-on: ubuntu-latest
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Java 1.8
uses: actions/setup-java@v3
with:
java-version: '1.8'
distribution: 'temurin'
- name: Create secrets.properties
run: |
echo "${{ secrets.SECRETS_PROPERTIES }}" > secrets.properties
- name: Load Google Service file
env:
DATA: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $DATA | base64 -di > app/google-services.json
- name: Build with Gradle
id: build
run: ./gradlew build
- name: Build the app
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.KEYSTORE }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Upload AAB
id: uploadArtifact
uses: actions/upload-artifact@v4
with:
name: app
path: app/build/outputs/bundle/release/app-release.aab
- name: Create service_account.json
id: createServiceAccount
run: echo '${{ secrets.PLAY_STORE_JSON }}' > service_account.json
- name: Deploy to Play Store (BETA)
id: deploy
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: service_account.json
packageName: ${{ secrets.PACKAGE_NAME }}
releaseFiles: "app/build/outputs/bundle/release/app-release.aab"
track: beta
whatsNewDirectory: whatsnew/
- name: Notify on Slack
uses: act10ns/slack@v1
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
if: always()