Workflow file for this run
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: CD Interactive Player Android build and distribution | |
on: | |
push: | |
branches: | |
- main | |
- bugfix/interactive-player-connect-adjusted-1.8.2 | |
tags: | |
- '*' | |
env: | |
GIT_USERNAME: "dolbyio-gh-bot" | |
jobs: | |
Android-Interactive-Player-Build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Cache Gradle Wrapper | |
uses: actions/cache@v3 | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | |
- name: Install the signing certificate | |
env: | |
DISTRIBUTION_CERTIFICATE_ANDROID_BASE64: ${{ secrets.RELEASE_KEYSTORE_BASE64 }} | |
run: | | |
INTERACTIVE_PLAYER_CERTIFICATE_PATH=./interactiveplayer/release.keystore | |
echo -n "$DISTRIBUTION_CERTIFICATE_ANDROID_BASE64" | base64 --decode > $INTERACTIVE_PLAYER_CERTIFICATE_PATH | |
- name: calculate Interactive Player App version | |
run: | | |
versionName='1.0.'$GITHUB_RUN_NUMBER | |
versionCode=$GITHUB_RUN_NUMBER; echo "versionName: $versionName; versionCode: $versionCode" | |
echo "export VERSION_NAME=$versionName; export VERSION_CODE=$versionCode" > ~/.env_interactive_player_version | |
- name: Interactive Player Release Build | |
env: | |
KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_STORE_PASSWORD }} | |
KEY_ALIAS: ${{ secrets.RELEASE_KEYSTORE_KEY_ALIAS }} | |
KEY_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_KEY_PASSWORD }} | |
GIT_PAT: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
export KEYSTORE_PASSWORD=$KEYSTORE_PASSWORD | |
export KEY_ALIAS=$KEY_ALIAS | |
export KEY_PASSWORD=$KEY_PASSWORD | |
source ~/.env_interactive_player_version | |
./gradlew interactiveplayer:assembleRelease interactiveplayer:bundleRelease | |
- name: Archive Interactive Player production bundle | |
uses: actions/upload-artifact@v3 | |
with: | |
name: interactive-player-release-bundle | |
path: | | |
./interactiveplayer/build/outputs/bundle/release/interactiveplayer-release.aab | |
Android-Play-Store-Distribution: | |
needs: Android-Interactive-Player-Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Cache Gradle Wrapper | |
uses: actions/cache@v3 | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | |
- name: Download release artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: interactive-player-release-bundle | |
path: ./interactiveplayer/build/outputs/bundle/release/ | |
- name: Create release notes | |
run: | | |
RELEASE_NOTES_FILE=./interactiveplayer/src/main/play/release-notes/en-US/default.txt | |
mkdir -p "$(dirname $RELEASE_NOTES_FILE)" && touch "$RELEASE_NOTES_FILE" | |
echo "Android Interactive Player app update: ${{ github.event.head_commit.message }}" > $RELEASE_NOTES_FILE | |
- name: Deploy Interactive Player app to Play Store | |
env: | |
ANDROID_PUBLISHER_CREDENTIALS: ${{ secrets.ANDROID_PUBLISHER_CREDENTIALS }} | |
GIT_PAT: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
versionName='1.0.'$GITHUB_RUN_NUMBER | |
versionCode=$GITHUB_RUN_NUMBER; echo "versionName: $versionName; versionCode: $versionCode" | |
export ANDROID_PUBLISHER_CREDENTIALS=$ANDROID_PUBLISHER_CREDENTIALS | |
chmod +x ./gradlew && ./gradlew interactiveplayer:publishReleaseBundle --artifact-dir ./interactiveplayer/build/outputs/bundle/release/ --release-name "$versionCode ($versionName)" --stacktrace |