CI / check (push) Canceled after 0s
Google Play Protect blocked installing beta.7, most likely for the
notification listener (notification summaries).
- A second flavour dimension, `reading`: `standard` declares no listener and
no permission of it; `notifications` is the full build plus the listener,
with the same application id and key. Variants: fullStandard,
fullNotifications, fdroidStandard (no F-Droid build with the listener).
The listener class and its manifest entry live in src/notifications only.
- Settings in a standard build says where notification summaries went and
why. The self-updater installs only its own kind: a notifications build
takes latest.json's optional `notifications {url, sha256}` or nothing.
- Release builds carry arm64-v8a and armeabi-v7a only; debug keeps x86_64
for the emulator. The engine's unused C and C++ API libraries are left out.
- scripts/check-apk.sh checks the built files (listener only where it may
be, model stored, no x86 in a release); CI runs it on the three debug APKs
and on an unsigned release build, release.yml on what it publishes.
- release.yml publishes llembas-android-<version>.apk, -notifications.apk
and -fdroid.apk with SHA256SUMS.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
91 lines
3.8 KiB
YAML
91 lines
3.8 KiB
YAML
name: Release
|
|
|
|
# A signed tag `vX.Y.Z` builds the three APKs, signed with the release key from the secrets,
|
|
# and publishes them with SHA256SUMS as the GitHub Release: the standard one, `-notifications`
|
|
# (the same app, id and key, plus the notification listener) and `-fdroid`. 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 testFullStandardReleaseUnitTest assembleFullStandardRelease assembleFullNotificationsRelease assembleFdroidStandardRelease
|
|
rm -f "$LEMBAS_KEYSTORE"
|
|
|
|
- name: Name the files and sum them
|
|
run: |
|
|
mkdir dist
|
|
cp app/build/outputs/apk/fullStandard/release/app-full-standard-release.apk "dist/llembas-android-$VERSION.apk"
|
|
cp app/build/outputs/apk/fullNotifications/release/app-full-notifications-release.apk "dist/llembas-android-$VERSION-notifications.apk"
|
|
cp app/build/outputs/apk/fdroidStandard/release/app-fdroid-standard-release.apk "dist/llembas-android-$VERSION-fdroid.apk"
|
|
# What is about to be published, checked on the files: the listener only in
|
|
# -notifications, the model stored, no x86_64 library.
|
|
scripts/check-apk.sh "dist/llembas-android-$VERSION.apk" standard release
|
|
scripts/check-apk.sh "dist/llembas-android-$VERSION-notifications.apk" notifications release
|
|
scripts/check-apk.sh "dist/llembas-android-$VERSION-fdroid.apk" fdroid release
|
|
{ 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/*
|