secubox-deb/.github/workflows/build-android-apk.yml
CyberMind-FR cf3aef48c8 feat(toolbox): serve Android APK from /wg/toolbox.apk + onboard button (#536)
Follow-up to #531 — one-tap APK install from the cabine.
  - api.py GET /wg/toolbox.apk: serve local APK (android content-type),
    302 → latest GitHub release asset if absent (never dead-ends).
  - /wg/onboard Android panels (inline + _install_panels): 📱 Installer
    l'app ToolBoX (1-tap) button.
  - sbin/secubox-toolbox-fetch-apk: pull latest release asset into the
    serve path (best-effort + APK magic check); postinst creates the dir
    + first fetch.
  - build-android-apk.yml: publish APK as release asset
    secubox-toolbox-android.apk on android-v* tags (contents:write).
  - changelog 2.6.13.

Live on gk2: /wg/toolbox.apk 302 → release (fallback, no release yet),
serve dir created, onboard button rendered.
2026-06-12 23:46:29 +02:00

71 lines
2.2 KiB
YAML

# SPDX-License-Identifier: LicenseRef-CMSD-1.0
# Build the SecuBox Android ToolBox client APK (#531).
# No Gradle wrapper jar is committed (text-only scaffold) — setup-gradle
# provides Gradle ; setup-android provides the SDK. Produces a debug APK
# artifact (sideloadable). Release signing is a follow-up (needs a
# keystore secret).
name: build-android-apk
on:
push:
branches: [ master ]
paths: [ "clients/android-toolbox/**", ".github/workflows/build-android-apk.yml" ]
tags: [ "android-v*" ]
pull_request:
paths: [ "clients/android-toolbox/**" ]
workflow_dispatch:
permissions:
contents: write # needed to attach the APK to a release on tags
jobs:
build:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: clients/android-toolbox
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
- name: Set up Android SDK
uses: android-actions/setup-android@v3
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: "8.9"
- name: Build debug APK
run: gradle :app:assembleDebug --no-daemon --stacktrace
- name: Upload APK artifact
uses: actions/upload-artifact@v4
with:
name: secubox-toolbox-android-debug
path: clients/android-toolbox/app/build/outputs/apk/debug/*.apk
if-no-files-found: error
# On android-v* tags, publish the APK as a release asset under the
# stable name the toolbox fetch helper + /wg/toolbox.apk expect
# (#536). `latest/download/secubox-toolbox-android.apk` resolves to
# whichever release is newest.
- name: Stage release asset
if: startsWith(github.ref, 'refs/tags/android-v')
run: |
mkdir -p "$GITHUB_WORKSPACE/release"
cp app/build/outputs/apk/debug/app-debug.apk \
"$GITHUB_WORKSPACE/release/secubox-toolbox-android.apk"
- name: Publish release
if: startsWith(github.ref, 'refs/tags/android-v')
uses: softprops/action-gh-release@v2
with:
files: release/secubox-toolbox-android.apk
fail_on_unmatched_files: true