update to buildToolsVersion "34.0.0" and targetSdkVersion 33 #2091
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: | |
paths-ignore: | |
- 'README.md' | |
- '.github/workflows/tests.yml' | |
pull_request: | |
paths-ignore: | |
- 'README.md' | |
- '.github/workflows/tests.yml' | |
workflow_dispatch: | |
inputs: | |
version: | |
description: dummy | |
default: dummy | |
jobs: | |
update-nightly-tag: | |
name: Update nightly release tag | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && github.ref == 'refs/heads/zoff99/dev003' | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Move nightly tag to head for nightly release | |
run: git tag -f nightly && git push origin nightly -f | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
- name: Install system packages | |
run: | | |
sudo apt-get update && \ | |
sudo DEBIAN_FRONTEND=noninteractive \ | |
apt-get install -y --no-install-recommends \ | |
zipalign \ | |
apksigner | |
- name: Install NDK | |
run: | | |
echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;21.0.6113669" --sdk_root=${ANDROID_SDK_ROOT} | |
echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;20.1.5948944" --sdk_root=${ANDROID_SDK_ROOT} | |
- name: Change to debug ID | |
run: | | |
datestr=$(date '+%Y%m%d%H%M%S') | |
cat android-refimpl-app/app/build.gradle | grep applicationId | |
sed -i -e 's#applicationId "com.zoffcc.applications.trifa"#applicationId "com.zoffcc.applications.trifa_debug_'"$datestr"'"#' android-refimpl-app/app/build.gradle | |
cat android-refimpl-app/app/build.gradle | grep applicationId | |
grep -rli std_fileprovider|grep -e '.java' -e '.xml'|xargs -L1 sed -i -e 's#com.zoffcc.applications.trifa.std_fileprovider#com.zoffcc.applications.trifa.std_fileprovider_debug_'"$datestr"'#' | |
grep -rli "com.zoffcc.applications.trifa.ext2_provider"|grep -e '.java' -e '.xml'|xargs -L1 sed -i -e 's#com.zoffcc.applications.trifa.ext2_provider#com.zoffcc.applications.trifa.ext2_provider_debug_'"$datestr"'#' | |
grep -rli "com.zoffcc.applications.trifa.ext1_fileprovider"|grep -e '.java' -e '.xml'| xargs -L1 sed -i -e 's#com.zoffcc.applications.trifa.ext1_fileprovider#com.zoffcc.applications.trifa.ext1_fileprovider_debug_'"$datestr"'#' | |
sed -i -e 's#android:label="TRIfA"#android:label="DEBUG TRIfA '"$datestr"'"#' android-refimpl-app/app/src/main/AndroidManifest.xml | |
cat android-refimpl-app/app/src/main/AndroidManifest.xml|grep 'android:label=' | |
- name: Build with Gradle | |
run: cd android-refimpl-app ; ./gradlew assemble ; find . -name '*.apk' | |
- name: generate debug key | |
run: keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname CN=appauth | |
- name: align and sign apk | |
run: | | |
zipalign -p 4 /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/android-refimpl-app/app/build/outputs/apk/debug/app-debug.apk /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/android-refimpl-app/app/build/outputs/apk/debug/app-debug-aligned.apk | |
apksigner sign --ks debug.keystore --ks-pass "pass:android" --ks-key-alias androiddebugkey --out /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/android-refimpl-app/app/build/outputs/apk/debug/app-debug.apk --verbose /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/android-refimpl-app/app/build/outputs/apk/debug/app-debug-aligned.apk | |
- name: upload apk | |
uses: actions/upload-artifact@v3 | |
with: | |
name: trifa | |
path: /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/android-refimpl-app/app/build/outputs/apk/debug/app-debug.apk | |
- name: Rename artifact for nightly upload | |
if: github.event_name == 'push' && github.ref == 'refs/heads/zoff99/dev003' | |
run: | | |
pwd | |
cp -av /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/android-refimpl-app/app/build/outputs/apk/debug/app-debug.apk TRIfA-nightly.apk | |
- name: Upload to nightly release | |
uses: ncipollo/release-action@v1 | |
if: github.event_name == 'push' && github.ref == 'refs/heads/zoff99/dev003' | |
with: | |
allowUpdates: true | |
tag: nightly | |
omitBodyDuringUpdate: true | |
omitNameDuringUpdate: true | |
prerelease: true | |
replacesArtifacts: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
artifacts: "TRIfA-nightly.apk" | |
gradle-wrapper-validation: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: gradle/wrapper-validation-action@v1.0.6 | |