From ec3740336938735a53194c37a7489b59ea31e92a Mon Sep 17 00:00:00 2001 From: Sudo-Ivan Date: Sat, 27 Dec 2025 12:11:20 -0600 Subject: [PATCH] Add Android build process and CI configuration - Updated Makefile to remove explicit JAVA_HOME export, simplifying the android-build command. - Added Java setup step in the Gitea workflow to ensure the correct Java version is used during builds. - Modified publish_build.sh to include the Android APK build step and copy the generated APK to the distribution directory. --- .gitea/workflows/publish.yml | 6 ++++++ Makefile | 2 +- scripts/publish_build.sh | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml index 7b593ec..631ba84 100644 --- a/.gitea/workflows/publish.yml +++ b/.gitea/workflows/publish.yml @@ -24,6 +24,12 @@ jobs: with: go-version: '1.25.4' + - name: Setup Java + uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 + with: + distribution: 'temurin' + java-version: '21' + - name: Install dependencies run: bash scripts/publish_setup.sh diff --git a/Makefile b/Makefile index 9d775ff..be1d3d6 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ help: android-build: build npx cap sync android - export JAVA_HOME=/usr/lib/jvm/java-21-openjdk && cd android && ./gradlew assembleDebug + cd android && ./gradlew assembleDebug mkdir -p $(BUILD_DIR)/android cp android/app/build/outputs/apk/debug/app-debug.apk $(BUILD_DIR)/android/web-news-debug.apk diff --git a/scripts/publish_build.sh b/scripts/publish_build.sh index ad24657..140faf9 100644 --- a/scripts/publish_build.sh +++ b/scripts/publish_build.sh @@ -26,6 +26,10 @@ elif [ -f "desktop/build/bin/web-news" ]; then cp desktop/build/bin/web-news dist/web-news-desktop-darwin fi +echo "Building Android APK..." +make android-build +cp bin/android/web-news-debug.apk dist/web-news-android-debug.apk + echo "Generating SHA256 hashes..." cd dist sha256sum * > SHA256SUMS