1.33 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
echo "Get access token for client id ${ANDROID_CLIENT_ID}"
ACCESS_TOKEN=$(curl "" -d "client_id=${ANDROID_CLIENT_ID}&client_secret=${ANDROID_CLIENT_SECRET}&refresh_token=${ANDROID_REFRESH_TOKEN}&grant_type=refresh_token&redirect_uri=urn:ietf:wg:oauth:2.0:oob" | jq -r .access_token)

echo "Create new edit for ${packageName}"
EDIT_ID=$(curl -H "Authorization: Bearer ${ANDROID_ACCESS_TOKEN}" -X POST${packageName}/edits | jq -r .id)

echo "Upload apk to Google Play for edit id ${EDIT_ID}"
curl -H "Authorization: Bearer ${ANDROID_ACCESS_TOKEN}" -X POST --header "Content-Type:application/" -T platforms/android/app/build/outputs/apk/release/app-release.apk -v "${packageName}/edits/${EDIT_ID}/apks?uploadType=media"

echo "Submit apk to Beta Track for edit id ${EDIT_ID}"
curl -H "Authorization: Bearer ${ANDROID_ACCESS_TOKEN}" -X PUT -v "${packageName}/edits/${CI_PIPELINE_IID}/tracks/beta"

echo "Commit edit id ${EDIT_ID}"
curl -H "Authorization: Bearer ${ANDROID_ACCESS_TOKEN}" -X POST${packageName}/edits/${EDIT_ID}:commit