Merge pull request #378 from toquete/delay #427
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: CD | |
'on': | |
push: | |
branches: | |
- master | |
tags: | |
- v* | |
env: | |
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }} | |
KEYSTORE_FILE: ${{ secrets.KEYSTORE_FILE }} | |
KEYSTORE_PROPERTIES: ${{ secrets.KEYSTORE_PROPERTIES }} | |
SERVICE_ACCOUNT_JSON: ${{ secrets.SERVICE_ACCOUNT_JSON }} | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: zulu | |
java-version: '17' | |
- name: Create keystore file | |
run: echo $KEYSTORE_FILE | base64 -di > ${{ github.workspace }}/app/release.jks | |
- name: Create keystore.properties file | |
run: echo $KEYSTORE_PROPERTIES | base64 -di > ${{ github.workspace }}/keystore.properties | |
- name: Create Google Services JSON | |
run: | | |
mkdir ${{ github.workspace }}/app/src/prod | |
echo $GOOGLE_SERVICES_JSON | base64 -di > ${{ github.workspace }}/app/src/prod/google-services.json | |
- name: Create service account JSON | |
run: echo $SERVICE_ACCOUNT_JSON | base64 -di > ${{ github.workspace }}/service-account.json | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
build-scan-publish: true | |
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" | |
build-scan-terms-of-use-agree: "yes" | |
- name: Build release APK | |
run: ./gradlew :app:assembleProdRelease | |
- name: Build release bundle | |
run: ./gradlew :app:bundleProdRelease | |
- name: Upload Release Build to Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: release-artifacts | |
path: | | |
app/build/outputs/apk/prod/release/ | |
app/build/outputs/bundle/prodRelease/ | |
- name: Create GitHub release | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: true | |
files: app/build/outputs/apk/prod/release/app-prod-release.apk | |
generate_release_notes: true | |
- name: Upload app to Google Play | |
uses: r0adkll/upload-google-play@v1 | |
with: | |
serviceAccountJson: ${{ github.workspace }}/service-account.json | |
packageName: com.toquete.boxbox | |
track: internal | |
status: draft | |
releaseFiles: app/build/outputs/bundle/prodRelease/app-prod-release.aab |