Skip to content

Prepare for 10.0.0-beta05 release (#174) #32

Prepare for 10.0.0-beta05 release (#174)

Prepare for 10.0.0-beta05 release (#174) #32

name: Publish Play Store Update
on:
push:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
# Fetch all history so that we can calculate the version code
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Write Smile Config
id: write_config
# Mask the config so it doesn't show up in the logs
run: |
echo "$SMILE_CONFIG" > sample/src/main/assets/smile_config.json
PARTNER_ID=$(jq -r '.partner_id' sample/src/main/assets/smile_config.json)
echo "partner_id=$PARTNER_ID" >> $GITHUB_OUTPUT
env:
SMILE_CONFIG: ${{ secrets.SMILE_CONFIG_PARTNER_2423 }}
- name: Decode Keystore
id: decode_keystore
uses: timheuer/base64-to-file@v1
with:
fileName: 'upload.jks'
fileDir: './sample'
encodedString: ${{ secrets.UPLOAD_KEYSTORE }}
# Release Notes consisting of the 5 most recent commits in the format "- [date] message"
# The file name format is dictated by the r0adkll/upload-google-play@v1 action
# Max length of 500 characters
- name: Generate Release notes
run: |
mkdir release_notes
git log --pretty=format:'- [%ad] %s' --date=short -n 5 > release_notes/whatsnew-en-US
- name: Short SHA
id: short_sha
run: |
echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Calculate Version Code
id: version_code
run: |
VERSION_CODE=$(git rev-list --count HEAD)
echo "Version Code for this build is $VERSION_CODE"
echo "version_code=$VERSION_CODE" >> $GITHUB_OUTPUT
- name: Assemble
uses: gradle/gradle-build-action@v2
with:
arguments: bundleRelease
env:
ORG_GRADLE_PROJECT_VERSION_CODE: ${{ steps.version_code.outputs.version_code }}
ORG_GRADLE_PROJECT_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
ORG_GRADLE_PROJECT_uploadKeystorePassword: ${{ secrets.UPLOAD_KEYSTORE_PASSWORD }}
- name: Deploy Sample App to Play Store Internal Testing Track
uses: r0adkll/upload-google-play@v1
id: upload_to_play_store
with:
serviceAccountJsonPlainText: ${{ secrets.PLAY_STORE_SERVICE_ACCOUNT_JSON }}
packageName: com.smileidentity.sample
track: internal
releaseFiles: sample/build/outputs/bundle/release/sample-release.aab
releaseName: ${{ steps.short_sha.outputs.short_sha }} (Partner ${{ steps.write_config.outputs.partner_id }})
whatsNewDirectory: release_notes