2024 Update to TB 15 #81
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: Android CI | |
on: | |
push: | |
branches: | |
- main | |
- feature/** | |
pull_request: | |
branches: | |
- main | |
- feature/** | |
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 "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: | | |
echo "Available build tools" | |
ls ${ANDROID_SDK_ROOT}/build-tools/ | |
echo "--------------------------------------" | |
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 Phone App Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: app-phone-signed-${{ github.run_number }}.apk | |
path: ${{ env.SIGNED_PHONE_ARTIFACT }} | |
- name: Upload Wear App Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: app-wear-signed-${{ github.run_number }}.apk | |
path: ${{ env.SIGNED_WEAR_ARTIFACT }} |