Publish Released APK's to Google Playstore as draft #14
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
# written in such a way that it is only need in obbimi/Squore create releases for all brands | |
name: Publish Released APK to Google | |
on: | |
workflow_dispatch: # run manually | |
inputs: | |
brand: | |
description: 'The brand to deploy: Squore/TennisPadel/Tabletennis/Badminton/Racketlon' | |
default: "Squore" | |
required: true | |
type: string | |
releasePrefix: | |
description: 'The prefix of the release that is published.' | |
default: "Release." | |
required: false | |
type: string | |
version: | |
description: 'The version to deploy: Last 3 digits of versionCode. A release named ${releasePrefix}${version} must exist and publicly accessible for the brand' | |
default: "526" | |
required: true | |
type: string | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
#strategy: | |
# matrix: | |
# apkversion: | |
# - phoneTabletPost23 | |
# - phoneTabletPre22 | |
steps: | |
- name: Download from /releases | |
id: download_apk_extract_info | |
run: | | |
set -x | |
androidhome="${ANDROID_HOME:-${ANDROID_SDK}}" | |
aaptPath=$(find ${androidhome}/build-tools -name aapt | sort | tail -1) | |
version=${{ inputs.version }} | |
brand=${{ inputs.brand }} | |
releasePrefix=${{ inputs.releasePrefix }} | |
apkversions="phoneTabletPost23 phoneTabletPre22" | |
filenames="" | |
for apkversion in $apkversions; do | |
echo ${apkversion} | |
fn=${brand}.${version}-${apkversion}-release-signed.apk | |
filenames="./${fn},${filenames}" | |
# download file | |
wget --quiet -O ${fn} https://github.com/obbimi/${brand}/releases/download/${releasePrefix}${version}/${fn} | |
# extract info from apk | |
PKG=$(${aaptPath} d badging ${fn} | grep pack | tr ' ' '\n' | grep -E ^name= | cut -d "'" -f 2) | |
echo "packageName=$PKG" > $GITHUB_OUTPUT | |
done | |
echo "filenames=$filenames" | sed 's~,$~~' > $GITHUB_OUTPUT | |
ls -l *.apk | |
# https://github.com/r0adkll/upload-google-play | |
- name: Publish to google play store 1 | |
uses: r0adkll/[email protected] | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} | |
packageName: ${{ steps.download_apk_extract_info.outputs.packageName }} | |
#releaseFiles: ./${{ inputs.brand }}.${{ inputs.version }}-${{ matrix.apkversion }}-release-signed.apk | |
releaseFiles: ${{ inputs.brand }}.${{ inputs.version }}-phoneTabletPost23-release-signed.apk,${{ inputs.brand }}.${{ inputs.version }}-phoneTabletPre22-release-signed.apk | |
track: beta # alpha,beta,internal or production | |
releaseName: ${{ inputs.version }} # if not specified typically derived from versionCode/versionName | |
#changesNotSentForReview: true # does not seem to work/be allowed anymore | |
# existingEditId: # A valid, unpublished Edit ID | |
status: draft | |
#inAppUpdatePriority: 2 | |
#status: inProgress #Error: Status 'inProgress' requires a 'userFraction' to be set: One of completed, inProgress, halted, draft. | |
#userFraction: 0.10 # not possible in alpha | |
#whatsNewDirectory: distribution/whatsnew | |
#mappingFile: app/build/outputs/mapping/release/mapping.txt | |
#debugSymbols: app/intermediates/merged_native_libs/release/out/lib | |
# "Error: The first release on a track cannot be staged" | |
# Changes are sent for review automatically. The query parameter changesNotSentForReview must not be set. |