Files
LLeMbas-Android/.github/workflows/release.yml
T
HomerandClaude Opus 5.5 dc642c62b9
CI / check (push) Canceled after 0s
Opt-in wake word: on-device keyword spotting in a microphone foreground service
- Engine: sherpa-onnx 2.0.1 keyword spotter (Apache-2.0) with the English
  zipformer-gigaspeech-3.3M KWS model (Apache-2.0, int8), fetched hash-pinned by
  scripts/fetch-wakeword.py into app/libs and src/full/assets (gitignored); CI and release run it.
  `full` flavour only (abiFilters arm64-v8a, armeabi-v7a, x86_64); `fdroid` has a stub engine
  and Settings says why. ProGuard keeps com.k2fsa.sherpa.onnx (JNI reads fields by name).
- WakeWordService (foregroundServiceType microphone): persistent notification with Stop; audio
  only to the engine in memory; pauses while the sheet is up (AssistPresence), in battery saver,
  and with the screen off unless Settings says otherwise. On the word: the sheet opens listening
  through LembasAssistService.showSession when LLeMbas is the assistant, else the activity,
  else a "tap to ask" notification.
- No microphone service at boot: WakeBootReceiver posts "tap to listen again"; MainActivity
  restarts a service the phone stopped.
- Settings › Assistant › Wake word: switch (off), four built-in English phrases (BPE-tokenized
  with the model's bpe.model), screen-on only, battery-optimisation page; privacy and cost text.
- The sheet's "no wake word" line now points at the setting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:27:51 +00:00

84 lines
3.1 KiB
YAML

name: Release
# A signed tag `vX.Y.Z` builds both flavours, signed with the release key from the secrets,
# and publishes them with SHA256SUMS as the GitHub Release. The release notes are the tag's
# message. The key never touches the repository: it is written to a temporary file here and
# deleted with the runner.
on:
push:
tags: ["v*"]
workflow_dispatch:
inputs:
tag:
description: Tag to build
required: true
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-24.04
timeout-minutes: 40
env:
TAG: ${{ github.event.inputs.tag || github.ref_name }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.TAG }}
- name: The tag object, for its message
run: git fetch --force origin "refs/tags/$TAG:refs/tags/$TAG"
- name: The version is the tag
run: |
version="$(sed -n -E 's/^ *versionName = "([^"]+)".*/\1/p' app/build.gradle.kts)"
[ "v$version" = "$TAG" ] || { echo "versionName $version is not $TAG" >&2; exit 1; }
echo "VERSION=$version" >> "$GITHUB_ENV"
- run: scripts/hygiene.sh
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
# The wake-word engine and model for the full build, hash-pinned (never in the repository).
- name: Wake-word engine (hash-pinned)
run: python3 scripts/fetch-wakeword.py
- uses: gradle/actions/wrapper-validation@v4
- uses: gradle/actions/setup-gradle@v4
- name: Build, signed
env:
KEYSTORE_B64: ${{ secrets.LEMBAS_KEYSTORE_B64 }}
LEMBAS_KEYSTORE_PASSWORD: ${{ secrets.LEMBAS_KEYSTORE_PASSWORD }}
LEMBAS_KEY_ALIAS: ${{ secrets.LEMBAS_KEY_ALIAS }}
LEMBAS_KEY_PASSWORD: ${{ secrets.LEMBAS_KEY_PASSWORD }}
run: |
[ -n "$KEYSTORE_B64" ] || { echo "no release key in the secrets" >&2; exit 1; }
export LEMBAS_KEYSTORE="$RUNNER_TEMP/release.jks"
echo "$KEYSTORE_B64" | base64 -d > "$LEMBAS_KEYSTORE"
./gradlew --no-daemon testFullReleaseUnitTest assembleFullRelease assembleFdroidRelease
rm -f "$LEMBAS_KEYSTORE"
- name: Name the files and sum them
run: |
mkdir dist
cp app/build/outputs/apk/full/release/app-full-release.apk "dist/llembas-android-$VERSION.apk"
cp app/build/outputs/apk/fdroid/release/app-fdroid-release.apk "dist/llembas-android-$VERSION-fdroid.apk"
{ echo "# llembas-android $VERSION"; (cd dist && sha256sum *.apk); } > SHA256SUMS
mv SHA256SUMS dist/
- name: Publish
env:
GH_TOKEN: ${{ github.token }}
run: |
git tag -l --format='%(contents)' "$TAG" | sed '/-----BEGIN SSH SIGNATURE-----/,$d' > notes.md
# A `-beta.N` tag is a pre-release: never "Latest", never what /releases/latest hands out.
pre=""
case "$TAG" in *-*) pre="--prerelease" ;; esac
gh release create "$TAG" --verify-tag $pre --title "LLeMbas for Android $VERSION" --notes-file notes.md dist/*