From bf7bf94b522b0c22a7aaf813de56bea03d527c61 Mon Sep 17 00:00:00 2001 From: James Tucker Date: Tue, 12 Mar 2024 11:46:26 -0700 Subject: [PATCH] .github/workflows,Makefile: add a build check CI for the new app Updates tailscale/tailscale#10992 Signed-off-by: James Tucker --- .github/workflows/android.yml | 34 +++++++++++++++++++ .../workflows/{build.yml => build-legacy.yml} | 4 +-- Makefile | 9 +++-- 3 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/android.yml rename .github/workflows/{build.yml => build-legacy.yml} (90%) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 0000000..540b110 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,34 @@ +name: Android CI + +on: + push: + branches: + - main + pull_request: + branches: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + + if: "!contains(github.event.head_commit.message, '[ci skip]')" + + steps: + + - name: Check out code + uses: actions/checkout@v3 + - uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + - name: Switch to Java 17 # Note: 17 is pre-installed on ubuntu-latest + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + + - name: Build APKs + run: make tailscale-new-debug.apk tailscale-new-fdroid.apk + + - name: Run tests + run: make test \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build-legacy.yml similarity index 90% rename from .github/workflows/build.yml rename to .github/workflows/build-legacy.yml index 34928b3..4ad12cf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build-legacy.yml @@ -1,4 +1,4 @@ -name: Build Debug APK +name: Build Legacy Debug APK on: push: @@ -27,5 +27,5 @@ jobs: distribution: 'temurin' java-version: '17' - - name: Build APK + - name: Build Legacy APK run: make tailscale-debug.apk diff --git a/Makefile b/Makefile index 5d47a40..92d3a1a 100644 --- a/Makefile +++ b/Makefile @@ -159,14 +159,19 @@ tailscale-fdroid.apk: $(AAR) (cd android_legacy && ./gradlew test assembleFdroidDebug) mv android_legacy/build/outputs/apk/fdroid/debug/android_legacy-fdroid-debug.apk $@ -tailscale-new-fdroid.apk: $(AAR) +tailscale-new-fdroid.apk: $(AAR_NEXTGEN) (cd android && ./gradlew test assembleFdroidDebug) mv android/build/outputs/apk/fdroid/debug/android-fdroid-debug.apk $@ -tailscale-new-debug: $(AAR) +tailscale-new-debug.apk: $(AAR_NEXTGEN) (cd android && ./gradlew test assemblePlayDebug) mv android/build/outputs/apk/play/debug/android-play-debug.apk $@ +tailscale-new-debug: tailscale-new-debug.apk + +test: $(AAR_NEXTGEN) + (cd android && ./gradlew test) + $(RELEASE_AAB): $(AAR) (cd android_legacy && ./gradlew test bundlePlayRelease) mv ./android_legacy/build/outputs/bundle/playRelease/android-play-release.aab $@