Skip to content

Update: Talkback 14 (2024) #67

Update: Talkback 14 (2024)

Update: Talkback 14 (2024) #67

Workflow file for this run

name: Android CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: set up JDK 1.11
uses: actions/setup-java@v1
with:
java-version: 1.11
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Run Build Script
run: |
echo "Staring build"
echo "Android sdk location: [${ANDROID_SDK_ROOT}]"
export ANDROID_SDK=${ANDROID_SDK_ROOT}
echo "SDK Check: ANDROID_SDK=${ANDROID_SDK}"
echo "-----------------------------------------------------"
echo "JAVA HOME: [${JAVA_HOME}]"
echo "-----------------------------------------------------"
echo "BUILD START"
./build.sh -p
echo "BUILD COMPLETE"
echo "-----------------------------------------------------"
echo "ARTIFACT INFORMATION"
ls -ln ./build/outputs/apk/phone/release/talkback-phone-release-unsigned.apk
ls -ln ./build/outputs/apk/wear/release/talkback-wear-release-unsigned.apk
- name: Sign Phone and Wear Artifacts
run: |
SIGNING_KEY=${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD=${{ secrets.KEY_STORE_PASSWORD }}
BUILD_TOOLS=33.0.0
BUILD_TOOLS_PATH=${ANDROID_SDK_ROOT}/build-tools/${BUILD_TOOLS}
ALIAS=${{ secrets.ALIAS }}
INPUT_FILE_PHONE=./build/outputs/apk/phone/release/talkback-phone-release-unsigned.apk
INPUT_FILE_WEAR=./build/outputs/apk/wear/release/talkback-wear-release-unsigned.apk
OUTPUT_FILE_PHONE="talkback-phone-release-signed-${{ github.run_number }}.apk"
OUTPUT_FILE_WEAR="talkback-wear-release-signed-${{ github.run_number }}.apk"
echo "${SIGNING_KEY}" | base64 --decode > talkback_keystore.jks
echo "SIGNING PHONE APK"
${BUILD_TOOLS_PATH}/zipalign -p -f 4 ${INPUT_FILE_PHONE} ${OUTPUT_FILE_PHONE}
${BUILD_TOOLS_PATH}/apksigner sign -ks talkback_keystore.jks --v1-signing-enabled true --v2-signing-enabled true --ks-key-alias ${ALIAS} --ks-pass pass:${SIGNING_PASSWORD} --key-pass pass:${SIGNING_PASSWORD} ${OUTPUT_FILE_PHONE}
${BUILD_TOOLS_PATH}/apksigner verify ${OUTPUT_FILE_PHONE}
echo "SIGNED_PHONE_ARTIFACT=${OUTPUT_FILE_PHONE}" >> $GITHUB_ENV
echo "---------------------------------------------"
echo "SIGNING WEAR APK"
${BUILD_TOOLS_PATH}/zipalign -p -f 4 ${INPUT_FILE_WEAR} ${OUTPUT_FILE_WEAR}
${BUILD_TOOLS_PATH}/apksigner sign -ks talkback_keystore.jks --v1-signing-enabled true --v2-signing-enabled true --ks-key-alias ${ALIAS} --ks-pass pass:${SIGNING_PASSWORD} --key-pass pass:${SIGNING_PASSWORD} ${OUTPUT_FILE_WEAR}
${BUILD_TOOLS_PATH}/apksigner verify ${OUTPUT_FILE_WEAR}
echo "SIGNED_WEAR_ARTIFACT=${OUTPUT_FILE_WEAR}" >> $GITHUB_ENV
echo "---------------------------------------------"
- name: Upload Mobile App Artifact
uses: actions/upload-artifact@v2
with:
name: app-phone-signed-${{ github.run_number }}.apk
path: ${{ env.SIGNED_PHONE_ARTIFACT }}
- name: Upload Wear App Artifact
uses: actions/upload-artifact@v2
with:
name: app-wear-signed-${{ github.run_number }}.apk
path: ${{ env.SIGNED_WEAR_ARTIFACT }}