Internal Play store release #50
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: Internal Play store release | |
on: workflow_dispatch | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up Java 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: '17' | |
cache: 'gradle' | |
- name: Cache Gradle packages | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Decode Keystore | |
env: | |
ENCODED_STRING: ${{ secrets.SIGNING_KEY }} | |
run: | | |
TMP_KEYSTORE_FILE_PATH="${GITHUB_WORKSPACE}"/app/keystore | |
mkdir "${TMP_KEYSTORE_FILE_PATH}" | |
echo $ENCODED_STRING | base64 -di > "${TMP_KEYSTORE_FILE_PATH}"/vlr-gg.jks | |
- name: Decode sentry.properties | |
env: | |
ENCODED_STRING: ${{ secrets.SENTRY_PROPERTIES }} | |
run: | | |
echo $ENCODED_STRING | base64 -di > "${GITHUB_WORKSPACE}"/sentry.properties | |
- name: Make gradlew executable and setup properties | |
env: | |
API_TOKEN: ${{ secrets.API_TOKEN }} | |
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }} | |
SIGNING_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
SIGNING_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} | |
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | |
run: | | |
touch local.properties | |
echo 'TOKEN="${{ env.API_TOKEN }}"' > local.properties | |
echo 'APPLICATION_ID="dev.staticvar.vlr"' >> local.properties | |
echo 'SENTRY_DSN=${{ env.SENTRY_DSN }}' >> local.properties | |
echo 'key.alias=${{ env.SIGNING_KEY_ALIAS }}' >> local.properties | |
echo 'key.password=${{ env.SIGNING_KEY_PASSWORD }}' >> local.properties | |
echo 'store.password=${{ env.SIGNING_STORE_PASSWORD }}' >> local.properties | |
chmod +x ./gradlew | |
- name: build prod | |
env: | |
FIREBASE_CONFIG_DEV: ${{ secrets.FIREBASE_CONFIG }} | |
run: | | |
touch app/google-services.json | |
echo $FIREBASE_CONFIG_DEV >> app/google-services.json | |
./gradlew app:bundleRelease -Psentry --stacktrace | |
- name: APK name and path | |
id: apk_details | |
run: | | |
echo "VERSION_NAME=$(echo $(find app/build/outputs/bundle/release/ "*.aab" -type f -size +1M -print -quit | head -n1) | awk -F\( '{print $NF}' | awk -F\) '{print $1}')" >> $GITHUB_ENV | |
echo "APK=$(find app/build/outputs/bundle/release/ "*.aab" -type f -size +1M -print -quit | head -n1)" >> $GITHUB_ENV | |
- name: Print Build details | |
run: | | |
echo "${{ env.APK }}" | |
echo "${{ env.VERSION_NAME }}" | |
echo "${{ github.workspace }}/${{ env.APK }}" | |
- name: Publish to play store | |
uses: r0adkll/[email protected] | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} | |
packageName: dev.staticvar.vlr | |
releaseFiles: app/build/outputs/bundle/release/*.aab | |
track: beta | |
inAppUpdatePriority: 5 | |
whatsNewDirectory: distribution/whatsnew | |
mappingFile: app/build/outputs/mapping/release/mapping.txt | |
- name: Push tag | |
id: tag_version | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
custom_tag: "${{ env.VERSION_NAME }}" | |
tag_prefix: "" | |
default_prerelease_bump: false | |
- name: Create a GitHub release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ steps.tag_version.outputs.new_tag }} | |
name: Release ${{ steps.tag_version.outputs.new_tag }} | |
artifacts: ${{ env.APK }} | |
- name: send telegram message on push | |
uses: appleboy/telegram-action@master | |
with: | |
to: ${{ secrets.CHAT_ID }} | |
token: ${{ secrets.BOT_TOKEN }} | |
document: ${{ env.APK }} | |
message: | | |
Published ${{ env.VERSION_NAME }} | |
https://github.com/${{ github.repository }}/releases/tag/${{steps.tag_version.outputs.new_tag}} | |
Early access app update released, should reflect on play store soon. |