-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: [ANDROAPP-6167] deploy to play store job
- Loading branch information
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# This is a basic workflow that is manually triggered | ||
|
||
name: Deploy to PLay Store | ||
|
||
env: | ||
# The name of the main module repository | ||
main_project_module: app | ||
|
||
# Controls when the action will run. Workflow runs when manually triggered using the UI | ||
# or API. | ||
on: | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "greet" | ||
greet: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Runs a single command using the runners shell | ||
- uses: actions/checkout@v3 | ||
|
||
# Set Repository Name As Env Variable | ||
- name: Set repository name as env variable | ||
run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV | ||
|
||
- name: Set Up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' # See 'Supported distributions' for available options | ||
java-version: '17' | ||
cache: 'gradle' | ||
|
||
- name: Change wrapper permissions | ||
run: chmod +x ./gradlew | ||
|
||
- name: Decode Keystore | ||
id: decode_keystore | ||
uses: timheuer/base64-to-file@v1 | ||
with: | ||
fileName: 'dhis_keystore.jks' | ||
encodedString: ${{ secrets.KEYSTORE }} | ||
- name: build prod | ||
run: ./gradlew app:assembleDhisRelease | ||
env: | ||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | ||
SIGNING_KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | ||
SIGNING_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | ||
SIGNING_STORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | ||
SIGNING_KEYSTORE_PATH: ${{ steps.decode_keystore.outputs.filePath }} | ||
|
||
- name: Read version name from file | ||
working-directory: ./gradle | ||
id: read-version | ||
run: echo "::set-output name=vName::$(grep 'vName' libs.versions.toml | awk -F' = ' '{print $2}' | tr -d '"')" | ||
|
||
# Deploy to Alpha in Play Store | ||
- name: Upload to Play Store | ||
uses: r0adkll/upload-google-play@v1 | ||
with: | ||
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} | ||
packageName: com.dhis2 | ||
releaseFile: ${{ env.main_project_module }}/build/outputs/apk/dhis/release/dhis2-v${{ steps.read-version.outputs.vName }}-dhis-release.apk | ||
track: alpha | ||
whatsNewDirectory: /whatsnew |