Skip to content

login: smoother create splitting (fixes #13083) (#13017) #1591

login: smoother create splitting (fixes #13083) (#13017)

login: smoother create splitting (fixes #13083) (#13017) #1591

Workflow file for this run

name: myPlanet release
on:
push:
branches:
- 'master'
workflow_dispatch:
jobs:
release:
name: myPlanet release
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
build: [default, lite]
env:
OUTPUTS: |
.apk
.apk.sha256
.aab
.aab.sha256
steps:
- name: checkout repository code
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: setup gradle
uses: gradle/actions/setup-gradle@v6
with:
gradle-version: wrapper
- name: set release version
run: echo ANDROID_VERSION=$(sed -n 's/.*versionName = "\([^"]*\)".*/\1/p' app/build.gradle) >> $GITHUB_ENV
- name: build release APK and AAB
env:
GRADLE_BUILD_CACHE_URL: ${{ secrets.GRADLE_BUILD_CACHE_URL }}
GRADLE_BUILD_CACHE_USER: ${{ secrets.GRADLE_BUILD_CACHE_USER }}
GRADLE_BUILD_CACHE_PASS: ${{ secrets.GRADLE_BUILD_CACHE_PASS }}
GRADLE_BUILD_CACHE_PUSH: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/claude/') || startsWith(github.ref, 'refs/heads/jules/') || startsWith(github.ref, 'refs/heads/codex/') || startsWith(github.ref, 'refs/heads/copilot/') }}
run: |
FLAVOR=${{ matrix.build }}
./gradlew assemble${FLAVOR^}Release bundle${FLAVOR^}Release --configuration-cache-problems=warn --warning-mode all --stacktrace --parallel --max-workers=4
ls -alR app/build/outputs
mkdir -p sign
cp app/build/outputs/bundle/${FLAVOR}Release/app-${FLAVOR}-release.aab sign/.
cp app/build/outputs/apk/${FLAVOR}/release/app-${FLAVOR}-release-unsigned.apk sign/.
VERSION=$(sed -n 's/.*versionName = "\([^"]*\)".*/\1/p' app/build.gradle)
if [ "$FLAVOR" == "lite" ]; then
VERSION="${VERSION}-lite"
fi
echo "ANDROID_VERSION_NAME=${VERSION}" >> $GITHUB_ENV
echo ANDROID_VERSION_CODE=$(grep versionCode app/build.gradle | sed 's/[^0-9]//g') >> $GITHUB_ENV
- name: sign release APK and AAB
uses: dogi/sign-android-release@v5.1
with:
releaseDirectory: sign
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: copy builds to output and generate sha256
run: |
mkdir -p output
FLAVOR=${{ matrix.build }}
cp sign/app-${FLAVOR}-release-unsigned-signed.apk output/myPlanet.apk
cp sign/app-${FLAVOR}-release.aab output/myPlanet.aab
sha256sum output/myPlanet.apk > output/myPlanet.apk.sha256
sha256sum output/myPlanet.aab > output/myPlanet.aab.sha256
ls -alR output
- name: set playstore variables
if: github.event_name != 'workflow_dispatch' && matrix.build == 'lite'
run: |
echo "PLAYSTORE_PACKAGE_NAME=org.ole.planet.myplanet" >> $GITHUB_ENV
echo "PLAYSTORE_RELEASE_FILE=output/myPlanet.aab" >> $GITHUB_ENV
echo "PLAYSTORE_TRACK=internal" >> $GITHUB_ENV
echo "PLAYSTORE_STATUS=completed" >> $GITHUB_ENV
echo "PLAYSTORE_RELEASE_NAME=${{ env.ANDROID_VERSION_CODE }} (${{ env.ANDROID_VERSION_NAME }})" >> $GITHUB_ENV
- name: publish AAB to playstore
id: playstore
if: github.event_name != 'workflow_dispatch' && matrix.build == 'lite'
continue-on-error: true
uses: dogi/upload-google-play@v1.1.4
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: ${{ env.PLAYSTORE_PACKAGE_NAME }}
releaseFiles: ${{ env.PLAYSTORE_RELEASE_FILE }}
track: ${{ env.PLAYSTORE_TRACK }}
releaseName: ${{ env.PLAYSTORE_RELEASE_NAME }}
status: ${{ env.PLAYSTORE_STATUS }}
- name: publish AAB to playstore fallback
if: github.event_name != 'workflow_dispatch' && matrix.build == 'lite' && steps.playstore.outcome == 'failure'
continue-on-error: true
uses: dogi/upload-google-play@v1.1.4
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: ${{ env.PLAYSTORE_PACKAGE_NAME }}
releaseFiles: ${{ env.PLAYSTORE_RELEASE_FILE }}
track: ${{ env.PLAYSTORE_TRACK }}
releaseName: ${{ env.PLAYSTORE_RELEASE_NAME }}
status: ${{ env.PLAYSTORE_STATUS }}
changesNotSentForReview: true
- name: rename APK and AAB with version and branch for artifact
if: github.event_name == 'workflow_dispatch'
run: |
echo "${{ env.OUTPUTS }}" | xargs -n 1 | while read type; do
mv "output/myPlanet${type}" "output/myPlanet-${{ env.ANDROID_VERSION_NAME }}-${GITHUB_REF##*/}${type}"
done
ls -alR output
echo "BRANCHNAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: upload APK and AAB as build artifact
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v7
with:
name: myPlanet-${{ env.ANDROID_VERSION_NAME }}-${{ env.BRANCHNAME }}
path: output/*
retention-days: 9
- name: pre-process files and tag for lite version
if: github.event_name != 'workflow_dispatch' && matrix.build == 'lite'
run: |
echo "${{ env.OUTPUTS }}" | xargs -n 1 | while read type; do
mv "output/myPlanet${type}" "output/myPlanet-lite${type}"
done
- name: release APK and AAB on GitHub
if: github.event_name != 'workflow_dispatch'
uses: dogi/upload-release-action@v2.9.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: output/*
tag: v${{ env.ANDROID_VERSION }}
overwrite: 'true'
file_glob: 'true'
- name: send success message to discord
if: github.event_name != 'workflow_dispatch' && matrix.build != 'lite'
run: |
sudo npm install -g @treehouses/cli
export discord_channel="${{ secrets.CHANNEL }}" #remote
echo "https://github.com/open-learning-exchange/myplanet/releases/tag/v${{ env.ANDROID_VERSION_NAME }}"
treehouses feedback "new myplanet app: <https://github.com/open-learning-exchange/myplanet/releases/tag/v${{ env.ANDROID_VERSION_NAME }}>"