Skip to content

Build

Build #37

Workflow file for this run

name: Build
on: [workflow_dispatch]
jobs:
build:
name: Generate APK
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.1
- name: Setup Java JDK
uses: actions/setup-java@v2
with:
java-version: 11.0.7
java-package: jdk
distribution: 'zulu'
- name: Assemble release APK
run: |
echo "$GOOGLE_SERVICES" >> app/google-services.json
echo "$KEYS_PROPERTIES" >> app/keys.properties
echo "$KEY_JKS" >> key.jks.enc
openssl base64 -d -in key.jks.enc -out key.jks
bash ./gradlew assembleRelease
bash ./gradlew bundleRelease
env:
KEYS_PROPERTIES: '${{ secrets.KEYS_PROPERTIES }}'
GOOGLE_SERVICES: '${{ secrets.GOOGLE_SERVICES }}'
KEY_JKS: '${{ secrets.KEY_JKS }}'
- name: Upload APK
uses: actions/upload-artifact@v2
with:
name: app-release
path: app/build/outputs/apk/release/app-release.apk
- name: Upload Bundle
uses: actions/upload-artifact@v2
with:
name: app-bundle
path: app/build/outputs/bundle/release/app-release.aab
github-release:
name: GitHub release
needs: build
runs-on: ubuntu-latest
steps:
- name: Download APK
uses: actions/download-artifact@v2
with:
name: app-release
path: app-release
- uses: marvinpinto/action-automatic-releases@latest
name: Uploading to GitHub
with:
repo_token: '${{ secrets.GITHUB_TOKEN }}'
automatic_release_tag: latest
prerelease: false
files: |
app-release/app-release.apk
playstore-release:
name: PlayStore Release
needs: github-release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.1
- name: Setup Java JDK
uses: actions/setup-java@v2
with:
java-version: 11.0.7
java-package: jdk
distribution: 'zulu'
- name: Retrieve serviceAccountJson
run: |
echo "$SERVICE_ACCOUNT_JSON" >> api-service-account.json
env:
SERVICE_ACCOUNT_JSON: '${{ secrets.SERVICE_ACCOUNT_JSON }}'
- name: Download bundle
uses: actions/download-artifact@v2
with:
name: app-bundle
path: app-bundle
- uses: r0adkll/upload-google-play@v1
name: Upload to PlayStore
with:
serviceAccountJson: api-service-account.json
packageName: in.co.rajkumaar.amritarepo
releaseFiles: app-bundle/app-release.aab
track: production
status: completed
whatsNewDirectory: distribution/