- Add GeminiCloudModel: proxies inference to Gemini 2.0 Flash via HTTPS using HttpURLConnection (no new deps). Supports both blocking and SSE streaming. Works from any context — background, emulator, CI. - Fix background inference: OnDeviceModel.create() now accepts an apiKey; when set, GeminiCloudModel is selected immediately, bypassing Gemini Nano's foreground-only restriction. ApiServerService reads the key from SharedPreferences at startup. - Add API key UI: password field in MainActivity saved to SharedPreferences before the service starts; disabled while server is running. - Add GitHub Actions CI (.github/workflows/ci.yml): build job produces a debug APK artifact; test job spins up a KVM-accelerated Android 31 emulator, installs the APK, writes the GEMINI_API_KEY secret into SharedPreferences via adb run-as, starts the service, and runs curl assertions against /health, /v1/models, /v1/chat/completions, and the SSE streaming endpoint. - Add release workflow (.github/workflows/release.yml): triggered on v* tags, builds the APK and creates a GitHub Release with it attached. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
46 lines
1.0 KiB
YAML
46 lines
1.0 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
jobs:
|
|
release:
|
|
name: Build and Release APK
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: "17"
|
|
distribution: "temurin"
|
|
|
|
- name: Cache Gradle
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
restore-keys: gradle-
|
|
|
|
- name: Build debug APK
|
|
run: ./gradlew assembleDebug --no-daemon
|
|
|
|
- name: Rename APK with version tag
|
|
run: |
|
|
TAG="${{ github.ref_name }}"
|
|
cp app/build/outputs/apk/debug/app-debug.apk "pixel10-ai-${TAG}.apk"
|
|
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: "pixel10-ai-${{ github.ref_name }}.apk"
|
|
generate_release_notes: true
|