diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml new file mode 100644 index 0000000..bec1f57 --- /dev/null +++ b/.forgejo/workflows/release.yml @@ -0,0 +1,38 @@ +name: Android Release + +on: + push: + tags: + - 'v*' + workflow_dispatch: + +jobs: + release-apk: + runs-on: android-ci + env: + GRADLE_VERSION: 8.10.2 + steps: + - name: Check out repository + run: | + git clone "http://forgejo:3000/${GITHUB_REPOSITORY}.git" . + git checkout "$GITHUB_SHA" + + - name: Install tools + run: | + apt-get update + apt-get install -y --no-install-recommends ca-certificates curl nodejs unzip + curl -fsSL "https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip" -o /tmp/gradle.zip + unzip -q /tmp/gradle.zip -d /opt + ln -s "/opt/gradle-${GRADLE_VERSION}/bin/gradle" /usr/local/bin/gradle + + - name: Build installable APK + run: | + gradle --no-daemon :app:assembleDebug + mkdir -p dist + cp app/build/outputs/apk/debug/app-debug.apk "dist/calorie-ai-${GITHUB_REF_NAME}.apk" + + - name: Upload APK artifact + uses: actions/upload-artifact@v3 + with: + name: calorie-ai-apk + path: dist/*.apk diff --git a/README.md b/README.md index adf8400..12eaaaa 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,8 @@ gradle :app:assembleDebug Forgejo Actions builds the debug APK on every push to `main` and uploads it as the `calorie-ai-debug-apk` artifact. +Tagged versions also build an installable APK named `calorie-ai-vX.Y.Z.apk` through the Android Release workflow. + ## AI Endpoint The app expects an OpenAI-compatible endpoint at: