提交 Haven Android 仓库源码 v5.87.79

This commit is contained in:
ali
2026-09-10 13:45:36 +08:00
parent 87b452c4dc
commit 22f4ca5830
2524 changed files with 599455 additions and 1 deletions
+2
View File
@@ -0,0 +1,2 @@
ko_fi: glassontin
github: GlassOnTin
@@ -0,0 +1,79 @@
name: Init submodules with retry
description: |
Run `git submodule update --init` with 3 attempts and a 15s backoff.
Use this AFTER `actions/checkout` (with `submodules: false`) in jobs
that need a submodule tree.
Why a separate action: gitlab.freedesktop.org (cairo / mesa-drm /
fontconfig / libxau / libxcb / wayland and friends — pulled
transitively via wayland-android) intermittently returns HTTP 500-503,
PROTOCOL_ERROR, or early EOF mid fetch-pack. Top-level repo checkout
from github.com is reliable; only the submodule init fails. Retrying
the same command almost always succeeds on attempt 2 or 3.
Failures on attempts 1-2 are emitted as `::warning::` so they show up
in the run summary but don't fail the job; failure on attempt 3 is a
real outage and fails the job with `::error::`.
### `paths` input
Default behaviour is `--recursive`, i.e. every submodule including the
freedesktop chain under `wayland-android`. Jobs that don't need the
Wayland native build (e.g. unit-test jobs that just compile Kotlin)
can pass `paths` to limit the init to a subset — typical safe set:
paths: |
termlib
mosh-kotlin
et-kotlin
reticulum-kt
rnsh-kt
build-proot/proot-termux
rclone-android
When `paths` is set the init is non-recursive and skips
`wayland-android` entirely, sidestepping freedesktop outages.
inputs:
paths:
description: |
Newline-separated list of submodule paths to init. Empty (default)
means init every submodule recursively, matching the prior
behaviour. When non-empty the init is non-recursive.
required: false
default: ""
runs:
using: composite
steps:
- name: Init submodules with retry
shell: bash
env:
SUBMODULE_PATHS: ${{ inputs.paths }}
run: |
set +e
# Build the submodule update command. Empty paths → recursive
# init of everything (legacy behaviour). Non-empty → non-recursive
# init of just the listed paths.
if [ -z "$SUBMODULE_PATHS" ]; then
cmd=(git submodule update --init --recursive --jobs 4)
else
# shellcheck disable=SC2206
paths=( $(echo "$SUBMODULE_PATHS" | tr '\n' ' ') )
cmd=(git submodule update --init --jobs 4 -- "${paths[@]}")
echo "Initialising only: ${paths[*]}"
fi
for attempt in 1 2 3; do
echo "::group::Submodule init attempt $attempt"
"${cmd[@]}"
rc=$?
echo "::endgroup::"
if [ "$rc" -eq 0 ]; then
echo "Submodules ready on attempt $attempt"
exit 0
fi
if [ "$attempt" -lt 3 ]; then
echo "::warning::Submodule init failed (rc=$rc) on attempt $attempt; sleeping 15s before retry"
sleep 15
fi
done
echo "::error::Submodule init failed after 3 attempts; upstream likely down"
exit 1
+243
View File
@@ -0,0 +1,243 @@
name: Set up Haven toolchain
description: >
Install and cache the full build toolchain — JDK 17, Android SDK/NDK/CMake,
Go + gomobile, Rust + cargo-ndk — shared by the CI and Release workflows.
Everything downloadable is cached; only the toolchain install steps that
can't be cached (setup-java, setup-android, setup-go) re-run each time,
but those complete in seconds off the runner image.
runs:
using: composite
steps:
# Free ~25GB of preinstalled software we don't use so Android SDK + NDK +
# Go + Rust + gradle caches fit on the runner disk.
- name: Free disk space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with:
tool-cache: false
android: false
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Install glibc cross-compilers for wayvnc shim
shell: bash
# core/local's buildWayvncShim Gradle task needs glibc-targeted
# aarch64 + x86_64 C compilers — the wayvnc capture-fallback shim
# runs inside the proot rootfs alongside glibc-based wayvnc, not
# on Android. The NDK's bionic libc is incompatible. Same package
# the F-Droid recipe installs at `sudo apt: gcc-aarch64-linux-gnu`.
#
# `libc6-dev-arm64-cross` and `libc6-dev-amd64-cross` ship the
# multi-arch glibc headers (e.g. bits/wordsize.h that pulls in
# via features-time64.h on Debian trixie) — the GHA Ubuntu image
# only has the native-arch libc6-dev, and `jlumbroso/free-disk-space`
# below strips even more. Without these, the cross gcc fails at
# compile time with "bits/wordsize.h: No such file or directory".
run: |
# The runner image ships packages.microsoft.com apt sources
# (azure-cli + microsoft-prod) that intermittently serve corrupt
# InRelease files ("Clearsigned file isn't valid, got 'NOSPLIT'"),
# failing this unwrapped apt-get update with exit 100 — two CI runs
# on 2026-07-07 alone. The cross-compilers below come from the
# Ubuntu archive, so drop the third-party sources instead of
# letting them flake the build.
sudo rm -f /etc/apt/sources.list.d/*microsoft* /etc/apt/sources.list.d/azure-cli*
# apt has NO default network timeout: stalled archive connections
# hung five jobs 15-30+ min each on 2026-08-19 (the job-level
# timeout-minutes didn't fire either). Acquire timeouts alone did
# NOT unstick it — a job hung with them in place, zero output —
# so every apt call gets a hard timeout(1) wall: a stall becomes
# a fast, retryable failure instead of a job-cap kill.
APT_OPTS="-o Acquire::Retries=3 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30"
apt_run() {
wall="$1"; shift
for attempt in 1 2 3; do
sudo timeout -k 30 "$wall" apt-get $APT_OPTS "$@" && return 0
echo "apt-get $1 failed or timed out (attempt $attempt)"
pgrep -a 'apt|dpkg' || true
# The azure mirror stalls mid-download from some runners
# (2026-08-19: an x64 release job burned 3x600s on it). The
# runner's ubuntu.sources point at this mirrorlist file, so
# overwriting it fails over every later fetch to the
# canonical archive; the bounded update refreshes indexes.
echo 'http://archive.ubuntu.com/ubuntu/ priority:1' | sudo tee /etc/apt/apt-mirrors.txt
sudo timeout -k 30 180 apt-get $APT_OPTS update -qq || true
sleep 5
done
echo "apt-get $1 failed after 3 attempts"
return 1
}
apt_run 180 update -qq
apt_run 600 install -y --no-install-recommends \
gcc-aarch64-linux-gnu libc6-dev-arm64-cross \
gcc-x86-64-linux-gnu libc6-dev-amd64-cross \
gcc-arm-linux-gnueabihf libc6-dev-armhf-cross \
meson ninja-build pkg-config bison \
autoconf automake libtool libtool-bin libltdl-dev \
libexpat1-dev libffi-dev xutils-dev python3-xcbgen \
nasm yasm gperf
# The second group above is what core/wayland's buildWaylandNatives needs
# (#493). Those five binaries are cross-compiled from the wayland-android
# submodule through meson/ninja, with wayland-scanner, xcb-proto and
# libxcb's autotools chain in the middle — none of which the GHA runner
# image carries. F-Droid's recipe installs the same set in its `sudo:`
# block, which is why their builds worked while ours had never tried.
#
# nasm/yasm are for x264 inside core/ffmpeg's buildFfmpegNatives, and are
# needed by the x86_64 ABI only — aarch64 and armv7 assemble through the
# NDK's own toolchain, x86_64 does not. That asymmetry is why this was
# missed: `ci.yml` builds arm64 alone, so the first thing ever to compile
# x264 for x86_64 was the v5.86.36 release matrix, which failed with
# "Found no assembler / Minimum version is nasm-2.13". F-Droid's `sudo:`
# list had both all along — treat that list as the spec.
#
# Kept in one apt-get with the cross-compilers on purpose: a second
# `apt-get update` is another chance to hit the flaky third-party sources
# dropped above.
- name: Set up JDK 17
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
java-version: '21'
distribution: 'temurin'
- name: Set up Android SDK
uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699 # v4.0.1
with:
# Default is "tools platform-tools"; the legacy `tools` package pulls
# the Android Emulator, whose CDN zip served corrupt twice on
# 2026-07-07 ("Error reading Zip content from a SeekableByteChannel"),
# failing setup before any code ran. Nothing in CI or Release uses the
# emulator or legacy tools — Gradle provisions build-tools/platforms
# itself via the accepted licenses.
packages: platform-tools
# Only install the NDK we pin in per-module ndkVersion
# (core/local + termlib/lib: 29.0.14206865, r29 stable). F-Droid's
# buildserver no longer pre-installs NDKs in the Docker image —
# fdroidserver.common.auto_install_ndk fetches whatever the
# manifest's ndk: field requests via sdkmanager on demand. Bumped
# off r28c (28.2.13676358) once Google moved that to the
# unsupported list (GlassHaven/Haven#77).
- name: Install SDK platforms 36+37, CMake, and NDK
shell: bash
run: sdkmanager "platforms;android-36" "platforms;android-37.0" "cmake;3.31.6" "ndk;29.0.14206865"
- name: Set up Go toolchain
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: '1.26'
cache-dependency-path: rclone-android/go/go.sum
# gomobile + gobind get re-downloaded + recompiled on every clean run
# (~1m). Cache the installed binaries in ~/go/bin keyed on the Go
# version so repeat runs skip the `go install`.
- name: Cache gomobile binaries
id: gomobile-cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/go/bin/gomobile
~/go/bin/gobind
key: gomobile-${{ runner.os }}-go1.26-mobile20251021151156
- name: Install gomobile
if: steps.gomobile-cache.outputs.cache-hit != 'true'
shell: bash
# Pin gomobile/gobind to the golang.org/x/mobile pseudo-version recorded
# in rclone-android/go/go.sum so the binding generator that produces the
# shipped libgojni.so can't drift on a `@latest` resolve. Bump this in
# lockstep with the go.sum entry (and the gomobile-cache key above).
run: |
go install golang.org/x/mobile/cmd/gomobile@v0.0.0-20251021151156-188f512ec823
go install golang.org/x/mobile/cmd/gobind@v0.0.0-20251021151156-188f512ec823
# fetchTessdata pulls ~4 MB from GitHub raw on every clean run, and
# shared runner IPs get rate-limited there (HTTP 429 killed a CI run).
# Restore the file from cache so the task's checksum check short-circuits
# the download; keyed on the build script so a version/SHA bump refetches.
- name: Cache tessdata
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: core/scan/src/main/assets/tessdata
key: tessdata-${{ hashFiles('core/scan/build.gradle.kts') }}
# Tool-version pins below match fdroiddata's sh.haven.app.yml recipe —
# the F-Droid buildserver is the authoritative environment (failing
# there blocks the public release), so our CI mirrors its versions
# rather than drifting ahead on `stable`. Update both places together.
#
# Rust note: the rdp-kotlin/rust build is governed by that crate's
# rust-toolchain.toml (channel 1.94.1), which overrides the rustup default
# below. We set the same version here so the global default and the
# crate-scoped toolchain agree. 1.94 is a hard floor, not a preference:
# the IronRDP crates are pinned to git and upstream's workspace
# `rust-version` is 1.94 (Devolutions/IronRDP#1495), so cargo refuses to
# build them on anything older. F-Droid's recipe still does
# `rustup default 1.85.0`, but its rdp build also obeys the toml — align
# it to 1.94.1 in a follow-up for clarity.
- name: Cache cargo-ndk
id: cargo-ndk-cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cargo/bin/cargo-ndk
key: cargo-ndk-${{ runner.os }}-3.5.4
- name: Set up Rust toolchain + cargo-ndk
shell: bash
run: |
rustup default 1.94.1
# Install every Android target up front (single-threaded). Leaving armv7
# to the crates' rust-toolchain.toml `targets` auto-install let the
# parallel rdp+spice cargo builds race to install rust-std-armv7 and hit
# `detected conflict: …/rustlib/armv7-linux-androideabi/lib/…rlib`.
rustup target add aarch64-linux-android x86_64-linux-android armv7-linux-androideabi
if [ ! -x ~/.cargo/bin/cargo-ndk ]; then
cargo install cargo-ndk --locked --version 3.5.4
fi
- name: Cache Gradle packages
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/libs.versions.toml') }}
restore-keys: gradle-${{ runner.os }}-
# Gradle build cache (org.gradle.caching) — the task-output store that lets
# test/lint/build/r8 stop each recompiling the whole tree. It MUST have a
# rolling key: the dependency cache above is keyed on hashFiles, which is
# stable across the many commits that don't touch build files, so its
# snapshot of build-cache-1 freezes at first-populate and never picks up
# later Kotlin changes. A run_id-suffixed key saves a fresh entry every run
# and restore-keys falls back to the newest prior one — so it accumulates.
# Restored after (and so wins over) the frozen copy inside the dep cache.
- name: Cache Gradle build cache (task outputs)
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.gradle/caches/build-cache-1
# v2 prefix bumped 2026-08-29: a corrupted task-output entry (mangled
# values-fr intermediate -> aapt2 "Invalid unicode escape sequence")
# was being restored by the old prefix on every run.
key: gradle-buildcache-v2-${{ runner.os }}-${{ github.run_id }}
restore-keys: gradle-buildcache-v2-${{ runner.os }}-
- name: Cache Cargo registry + rdp-kotlin target
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/.cargo/registry
~/.cargo/git
rdp-kotlin/rust/target
prns/prns-host/abi/c/target
key: cargo-${{ runner.os }}-${{ hashFiles('rdp-kotlin/rust/Cargo.lock', 'prns/prns-host/abi/c/Cargo.lock') }}
restore-keys: cargo-${{ runner.os }}-
- name: Grant execute permission for gradlew
shell: bash
run: chmod +x gradlew
+40
View File
@@ -0,0 +1,40 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 5
- package-ecosystem: gradle
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 10
ignore:
# termlib is a first-party fork consumed as a git submodule:
# settings.gradle.kts includeBuild substitutes org.connectbot:termlib
# with the local build, so a version bump here changes nothing built
# and upstream releases don't track the fork.
- dependency-name: "org.connectbot:termlib"
- package-ecosystem: cargo
directory: /rdp-kotlin/rust
schedule:
interval: weekly
open-pull-requests-limit: 5
# prns is an upstream-tracking submodule; its crate bumps arrive via
# upstream trunk, but the detached abi/c workspace lockfile is watched so
# advisories against its pinned graph surface here too.
- package-ecosystem: cargo
directory: /prns/prns-host/abi/c
schedule:
interval: weekly
open-pull-requests-limit: 2
- package-ecosystem: gomod
directory: /rclone-android/go
schedule:
interval: weekly
open-pull-requests-limit: 5
+404
View File
@@ -0,0 +1,404 @@
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Nightly broad net: full lint, the R8 smoke, and an all-ABI build — the
# slow/low-per-commit-signal work pulled off every main push (below) still
# runs within 24h, so a lint regression or an x64/armv7-specific breakage
# the arm64-only per-push build would miss is caught daily.
schedule:
- cron: '0 3 * * *' # 03:00 UTC daily
workflow_dispatch:
concurrency:
# Event-scoped so a main push doesn't cancel an in-flight nightly (both
# resolve github.ref to refs/heads/main and would otherwise collide).
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
# Least-privilege floor. Every job here only reads the repo and uploads
# artifacts (which use the Actions runtime token, not GITHUB_TOKEN), so a
# read-only token is sufficient. Jobs needing more would declare their own.
permissions:
contents: read
jobs:
# Fast supply-chain guards — no toolchain, runs in parallel with the build
# jobs and fails the run early if hardening regresses.
supply-chain:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: false
# Every external action must be pinned to a 40-char commit SHA. A bare
# `@v1`/`@main`/`@master` ref is mutable and re-pointable (tj-actions
# CVE-2025-30066 class). Local `./.github/actions/*` refs are exempt.
- name: Assert external actions are SHA-pinned
run: |
if grep -rEn 'uses: [^.].+@(v[0-9]|main|master)' .github/workflows .github/actions; then
echo "::error::Unpinned external action ref(s) above — pin to a 40-char SHA (# vX.Y.Z)."
exit 1
fi
# A submodule here is not vendored data. settings.gradle.kts pulls
# several in with includeBuild(), so their own build.gradle.kts files are
# EXECUTED on this runner — the URL in .gitmodules decides whose build
# logic runs with CI's privileges.
#
# Not hypothetical: PR #589 repointed termlib at a contributor's fork so
# CI could fetch a review SHA, and every job went green while building
# it. The checkmarks vouching for that PR were produced by executing the
# unreviewed code they were vouching for. Pinning the SHA keeps the
# content honest — git is content-addressed, so nobody can swap what is
# at a given commit — but it does not make the source ours.
#
# The registration is also sticky: `git submodule init` will not
# overwrite a URL a checkout already has, so a repoint outlives the
# commit that introduced it. That is how #525 froze F-Droid's build
# channel for a day while every build of ours stayed green.
- name: Assert submodules point at first-party repos
run: |
foreign=$(git config -f .gitmodules --get-regexp '\.url$' \
| grep -vE ' https://github\.com/GlassOnTin/' || true)
if [ -n "$foreign" ]; then
echo "$foreign"
echo "::error::Submodule URL(s) above are not under github.com/GlassOnTin. A submodule's build scripts execute on this runner; merge the commit into our fork and point at that SHA instead."
exit 1
fi
# Validate the gradle-wrapper.jar that CI actually executes against
# Gradle's published checksums (wrapper-attack class). Submodule wrappers
# aren't executed by CI, so the root jar is the one that matters.
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0
# rdp-kotlin's Rust suite had no CI step at all, so it was gated by whoever
# last remembered to run it by hand. Not hypothetical: the #422 test
# asserting an under-declared totalLength must *not* decode kept asserting it
# after the IronRDP pin moved to make it decode, and stayed green-by-absence
# until someone ran it locally.
#
# Its own job rather than a step in `test`: that job already runs 14-30m
# against a 45m cap and has been stamped `cancelled` once for finishing two
# seconds late (see its comment), so it is the wrong place to add minutes.
# This needs no submodules, no NDK and no Gradle, so standalone it is cheap
# and runs in parallel.
rdp-rust-test:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: false
# No toolchain setup step: rdp-kotlin/rust/rust-toolchain.toml pins the
# channel and rustup installs it on first use. That file is also why this
# runs from the crate directory rather than with --manifest-path from the
# root — rustup resolves the toolchain from the working directory, so the
# root would silently get the runner's default rustc, which IronRDP's
# rust-version then rejects.
- name: Run RDP transport Rust tests
working-directory: rdp-kotlin/rust
run: cargo test
# Prns C-ABI capsule tests on the host toolchain. Scoped to the detached
# abi/c workspace (its own committed Cargo.lock) — the full upstream
# workspace carries embedded targets this runner can't build.
prns-rust-test:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: false
- name: Checkout prns submodule
run: git submodule update --init prns
- name: Run Prns capsule tests
working-directory: prns/prns-host/abi/c
run: cargo test
# Host-built proot exercising the link2symlink emulation: refcounts,
# PROOT_L2S_DIR payload relocation (the Nix/libgit2 tarball-cache
# durability fix, discussion #536), and broken-chain fail-soft. Runs on
# the host kernel — ptrace works on GitHub runners; no Android needed.
proot-l2s-test:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: false
- name: Checkout proot submodule
run: git submodule update --init build-proot/proot-termux
- name: Install talloc, busybox, and lld
# gcc-multilib: the x86_64 build also compiles a 32-bit loader
# (HAS_LOADER_32BIT) and needs the i386 libc headers.
#
# Bounded like setup-toolchain's apt step: apt has no default
# network timeout, and this exact step sat stalled until the
# 15-minute job cap killed it TWICE on 2026-08-19 (runs
# 32233158153, 32236122541) — the second time WITH Acquire
# timeouts in place and zero output, so a hard timeout(1) wall
# per attempt is what actually bounds it.
run: |
APT_OPTS="-o Acquire::Retries=3 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30"
apt_run() {
wall="$1"; shift
for attempt in 1 2 3; do
sudo timeout -k 30 "$wall" apt-get $APT_OPTS "$@" && return 0
echo "apt-get $1 failed or timed out (attempt $attempt)"
pgrep -a 'apt|dpkg' || true
# Fail over to the canonical archive when the azure mirror
# stalls (see setup-toolchain for the incident detail).
echo 'http://archive.ubuntu.com/ubuntu/ priority:1' | sudo tee /etc/apt/apt-mirrors.txt
sudo timeout -k 30 180 apt-get $APT_OPTS update -qq || true
sleep 5
done
echo "apt-get $1 failed after 3 attempts"
return 1
}
apt_run 180 update -qq
apt_run 600 install -y -qq libtalloc-dev busybox-static clang lld gcc-multilib
# clang+lld, not gcc+GNU-ld: the loader's hardcoded --rosegment is an
# LLD flag (the production NDK toolchain is clang+lld too) and older
# GNU ld rejects it.
- name: Build host proot
run: make -C build-proot/proot-termux/src proot CC="clang -fuse-ld=lld"
- name: Run link2symlink tests
run: |
cd build-proot/proot-termux/tests
for t in test-l2s-refcount.sh test-l2s-dir.sh test-l2s-broken-chain.sh test-l2s-guest-dir.sh; do
echo "=== $t"
env PROOT="$PWD/../src/proot" sh -e "$t"
done
# Three independent Gradle entry-points run as parallel jobs instead of
# sequentially in one. Each restores the shared toolchain + caches from
# the composite action; the second run of each job type reuses the cache
# populated by the first, so the duplicated cache-restore cost is minimal.
test:
runs-on: ubuntu-latest
# 45, not 30: on 4e06876c this job did 30m07s of real work against a 30m
# cap and was stamped `cancelled` two seconds into cleanup — with every
# step green and "BUILD SUCCESSFUL in 15m 14s" already in the log. That
# reads as a red main for a run that actually passed. The spend is
# genuine, not a hang: ~10.5m initialising submodules (the wayland tree
# alone is a dozen nested repos), ~3.5m toolchain, ~15m tests. Observed
# totals range 14m-30m depending on Gradle cache hits, so the cap has to
# clear the top of that spread, not sit on it. Cutting the submodule cost
# is the real fix; this stops it failing releases meanwhile.
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: false
- uses: ./.github/actions/init-submodules-with-retry
- uses: ./.github/actions/setup-toolchain
- name: Run unit tests
# :app uses ABI product flavors, so the unqualified `testDebugUnitTest`
# matches no :app task and silently skips the agent/MCP unit tests.
# Name the flavor task explicitly (arm64 only — unit tests are
# flavor-agnostic) so they actually run in CI.
#
# The sshlib contract tests are excluded here and run in their own
# non-gating step below. They exercise the opt-in preview SSH engine
# against an upstream race in sshlib 0.4.1 — its output pump is
# cancelled on CHANNEL_CLOSE and drops whatever it is still holding, so
# a command's stdout or stderr comes back empty or truncated at random
# (connectbot/cbssh#245, tracked in #448). Haven narrows the window but
# cannot close it from outside the library, and 0.4.1 is the latest
# release. Three failures in one day, on three different assertions,
# blocked a release that changed nothing in core/ssh — so this engine's
# known flakiness no longer gates shipping for the default JSch engine.
# Restore it here the moment a fixed sshlib is out.
run: >-
./gradlew testDebugUnitTest :app:testArm64FullDebugUnitTest
-PexcludeSshlibContractTests=true
-PskipWaylandNatives=true
-PskipFfmpegNatives=true
- name: Run sshlib contract tests (non-gating, connectbot/cbssh#245)
# Reported, never silent: a failure here is visible in the job summary
# and the uploaded results, it just does not fail the build. If these
# start failing *every* run rather than intermittently, that is a real
# regression and not the upstream race — check before dismissing it.
#
# That last sentence used to be the reader's job. Since #475 the
# test-retry plugin gives SshlibExecContractTest three attempts (and
# only that class — verified by making a test in another core:ssh class
# fail and watching it run once), so a red step here already means
# "failed three times in a row" rather than "flaked once". The signal
# is now worth acting on instead of squinting at.
continue-on-error: true
run: ./gradlew :core:ssh:testDebugUnitTest --tests 'sh.haven.core.ssh.sshlib.*' -PskipWaylandNatives=true -PskipFfmpegNatives=true
- name: Upload test results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: test-results
path: '**/build/reports/tests/'
retention-days: 14
# Fast source-level gates — no Android toolchain, no submodules, ~30s. Split
# out of the lint job so they keep running on EVERY push (a version bump
# without CHANGELOG notes, a hardcoded string, or stale i18n export must fail
# fast) even though the slow lintDebug moved to PR + nightly.
checks:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: false
- name: Check CHANGELOG has notes for the current version
run: ./scripts/check-changelog.sh
- name: Check for hardcoded UI strings (#210)
run: ./scripts/check-i18n-hardcoded.sh
- name: Check every English key exists in all 11 locales
# Android's MissingTranslation lint is downgraded to a warning in
# build.gradle.kts and lintDebug only runs on PRs, so direct pushes to
# main used to ship untranslated keys silently — 37 keys had drifted out
# of all 11 locales at once. This runs per-push instead.
run: python3 scripts/check-i18n-coverage.py
# check-native-libs.sh is NOT here: this job does not build, and since
# #493 stopped committing the wayland .so there is nothing for it to read
# at this point. It printed "does not exist; nothing to check" on every
# run — a gate reporting success for doing nothing. It now runs in `build`,
# after the binaries exist.
- name: Check no new binaries are committed
# Binaries are unauditable in review and go stale silently (#469).
# Blocks any NEW one; the pre-existing set is grandfathered in the
# script and that list can only shrink.
run: ./scripts/check-no-committed-binaries.sh
- name: Check translation export is current
# docs/i18n/strings.json feeds the Pages translation page. Regenerate
# and fail if it drifted from the strings.xml sources (rerun
# scripts/i18n_export.py and commit the result).
run: |
python3 scripts/i18n_export.py
git diff --exit-code docs/i18n/strings.json
# Full Android lint is slow (~13 min) and rarely catches a per-commit
# regression the tests don't — so it runs on PRs and the nightly schedule,
# not on every direct main push. The fast source gates above still run
# per-push. github.event_name is 'push' only for direct main pushes.
lint:
if: github.event_name != 'push'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: false
- uses: ./.github/actions/init-submodules-with-retry
- uses: ./.github/actions/setup-toolchain
- name: Run lint
# Skip the from-source native builds. Android lint analyses sources,
# resources and the manifest — it never opens a .so. Since #493 wired
# those builds into preBuild they were costing this job ~20 minutes it
# had no use for, and lint died on its own 30-minute timeout three
# nights running without ever reaching the lint step (the log ends
# inside clang++). A job killed by a timeout reports `cancelled`, which
# reads as "superseded" — so the nightly lint gate stopped producing a
# verdict and nothing said so.
run: ./gradlew lintDebug -PskipWaylandNatives=true -PskipFfmpegNatives=true
- name: Upload lint results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: lint-results
path: |
**/build/reports/lint-results-debug.html
**/build/reports/lint-results-debug.xml
if-no-files-found: ignore
retention-days: 14
build:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: false
- uses: ./.github/actions/init-submodules-with-retry
- uses: ./.github/actions/setup-toolchain
# Build arm64 only in CI — the x64 flavor exists for emulator support
# and Play Store fat distribution, not smoke-testing main. Cuts build
# work roughly in half vs :app:assembleDebug (which expands to both).
- name: Build arm64 debug APK
# -PtargetAbi drives core/wayland's buildWaylandNatives, which builds the
# five arm64-only wayland binaries from the submodule instead of shipping
# committed copies. This job is what proves they still compile (#493).
run: ./gradlew :app:assembleArm64FullDebug -PtargetAbi=arm64
# Runs here rather than in `checks` because it reads the built binaries,
# and nothing builds them there. #469 was a wayland library linked without
# gen-stubs.sh's weak stubs: 51 undefined symbols, dlopen refused it, and
# every cage/app-window feature died on-device with a green build. Source
# now, rather than a committed copy, does not make that unlinkable-output
# case impossible — only unobservable until someone runs it.
- name: Assert native libs resolve their stubs (#469)
run: ./scripts/check-native-libs.sh
- name: Upload debug APK
if: success()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: app-debug
path: app/build/outputs/apk/arm64Full/debug/haven-*-arm64-debug.apk
retention-days: 7
# Nightly-only: build the ABIs the per-push `build` job skips (x64, armv7)
# so an x64/armv7-specific compile or native-cross break surfaces within 24h
# instead of only at release. arm64 is already covered per-push by `build`
# (which also runs on the schedule), so it's not repeated here.
nightly-abi:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- { abi: x64, variant: X64 }
- { abi: armv7, variant: Armv7 }
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: false
- uses: ./.github/actions/init-submodules-with-retry
- uses: ./.github/actions/setup-toolchain
- name: Build ${{ matrix.abi }} debug APK
run: ./gradlew :app:assemble${{ matrix.variant }}FullDebug -PtargetAbi=${{ matrix.abi }}
# Debug builds don't run R8, so an R8 rename of a reflectively-loaded class
# can ship a feature 100% broken in release while every debug check stays
# green — exactly how the email feature broke once (R8 renamed
# com.sun.mail.imap.IMAPSSLStore → getStore("imaps") threw, fixed v5.59.45).
# This runs R8 on the release variant and asserts the by-name-loaded classes
# survive (no keystore — minify precedes signing).
#
# Every published release is already R8-checked in release.yml (the assert
# moved there), so this job is early-feedback only: PRs (catch a -keep
# regression before merge) + the nightly schedule (the direct-main-push
# safety net), skipping direct main pushes where it paced every run ~16 min.
# github.event_name is 'push' only for direct main pushes.
release-r8-smoke:
if: github.event_name != 'push'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: false
- uses: ./.github/actions/init-submodules-with-retry
- uses: ./.github/actions/setup-toolchain
- name: R8 the release variant
# Same skip as lint, same reason: R8 shrinks bytecode and never reads
# jniLibs, but it sits downstream of preBuild and was paying for the
# native builds anyway. This job hit its 30-minute timeout on the same
# three nights, so the R8-keep assertion below has not actually run
# since the from-source work landed.
run: ./gradlew :app:minifyArm64FullReleaseWithR8 -PskipWaylandNatives=true -PskipFfmpegNatives=true
- name: Assert reflectively-loaded classes survived R8
run: ./scripts/check-r8-kept-classes.sh
+74
View File
@@ -0,0 +1,74 @@
name: Extract release-signing secrets (one-shot)
# Manual-only workflow that bundles the release keystore + signing passwords
# into a passphrase-encrypted tarball, uploads it as a 1-day artifact, then
# discards the cleartext. The encryption passphrase is the BUNDLE_PASSPHRASE
# repo secret (NOT a workflow_dispatch input — dispatch inputs are recorded in
# run metadata, which is public on a public repo). Decrypt locally with the
# same secret value:
#
# openssl enc -aes-256-cbc -pbkdf2 -iter 200000 -d \
# -pass pass:"$BUNDLE_PASSPHRASE" \
# -in bundle.tar.gz.enc -out bundle.tar.gz
# tar -xzf bundle.tar.gz
#
# The `haven-release.env` file inside is `source`-able and sets the same env
# vars the release workflow consumes.
on:
workflow_dispatch:
permissions:
contents: read
jobs:
extract:
runs-on: ubuntu-latest
# Reviewer-gated via the `signing` Environment so exporting the signing
# identity can't happen without an approval.
environment: signing
steps:
- name: Sanity-check passphrase is set and long enough
env:
PASSPHRASE: ${{ secrets.BUNDLE_PASSPHRASE }}
run: |
if [ "${#PASSPHRASE}" -lt 16 ]; then
echo "BUNDLE_PASSPHRASE secret is unset or shorter than 16 characters." >&2
exit 1
fi
- name: Bundle keystore + passwords (encrypted in-place)
env:
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
PASSPHRASE: ${{ secrets.BUNDLE_PASSPHRASE }}
run: |
umask 077
# Reconstruct the keystore from base64.
printf '%s' "$KEYSTORE_BASE64" | base64 -d > haven-release.jks
# Write a source-able env file. printf %q shell-escapes each value
# so passwords containing $, !, ', etc. round-trip correctly.
{
printf 'export KEYSTORE_PASSWORD=%q\n' "$KEYSTORE_PASSWORD"
printf 'export KEY_ALIAS=%q\n' "$KEY_ALIAS"
printf 'export KEY_PASSWORD=%q\n' "$KEY_PASSWORD"
} > haven-release.env
tar -czf bundle.tar.gz haven-release.jks haven-release.env
openssl enc -aes-256-cbc -pbkdf2 -iter 200000 \
-pass env:PASSPHRASE \
-in bundle.tar.gz -out bundle.tar.gz.enc
# Wipe cleartext.
shred -u haven-release.jks haven-release.env bundle.tar.gz
- name: Upload encrypted bundle
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: signing-bundle
path: bundle.tar.gz.enc
retention-days: 1
if-no-files-found: error
+324
View File
@@ -0,0 +1,324 @@
name: Release
on:
push:
tags: [ 'v*' ]
workflow_dispatch:
# Shared by both jobs.
env:
# Force any JS action still declaring node20 onto Node.js 24 (GitHub
# deprecated node20 runners 2026-06-02). All pinned actions are node24-native
# as of the v7/v8/v3 bumps; kept as a safety net for future additions.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
# Least-privilege floor. verify-ci/test/build only read; publish raises its
# own block for the release upload + provenance.
permissions:
contents: read
jobs:
# Skip a full ~16 min unit-test re-run when CI has already
# verified the tagged commit on main — same commit, same test invocation
# would produce the same result. Falls through to a real test run if
# CI hasn't reported yet (rare: tag created without a prior main push)
# or reported anything other than success.
verify-ci:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
ci-passed: ${{ steps.check.outputs.passed }}
steps:
- name: Check CI status on tagged commit
id: check
env:
GH_TOKEN: ${{ github.token }}
run: |
# Ask the CI workflow directly whether it passed on THIS commit.
#
# Do NOT use /commits/{sha}/status: that endpoint aggregates the legacy
# Statuses API, and GitHub Actions publishes *check runs*, not statuses.
# This repo has zero statuses, so it answered "pending" for every commit
# ever tagged — meaning this job never once skipped the test re-run it
# exists to skip, and every release paid ~16 minutes for nothing.
#
# /commits/{sha}/check-runs is the check-run equivalent but includes this
# very workflow's own in-flight runs, so it can never be all-green either.
# Filtering the CI workflow's completed runs by head_sha asks exactly the
# question we mean: "did CI pass on this commit?"
conclusion=$(gh api \
"repos/${GITHUB_REPOSITORY}/actions/workflows/ci.yml/runs?head_sha=${GITHUB_SHA}&status=completed" \
--jq '.workflow_runs[0].conclusion // "none"' 2>/dev/null || echo "unknown")
echo "CI conclusion for ${GITHUB_SHA:0:7}: ${conclusion}"
if [ "$conclusion" = "success" ]; then
echo "passed=true" >> "$GITHUB_OUTPUT"
else
# Fail safe: anything else (no CI run yet, failure, API trouble) runs
# the tests for real rather than shipping on an unverified commit.
echo "passed=false" >> "$GITHUB_OUTPUT"
fi
# Unit tests run once — flavor-agnostic, not worth duplicating per ABI.
# Skipped entirely when CI already reported success for this SHA.
# Runs on the free 4-core runner; larger runners are paid-tier and were
# silently queueing release builds once that budget was exhausted.
test:
needs: verify-ci
if: needs.verify-ci.outputs.ci-passed != 'true'
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: false
# Unit tests don't compile the Wayland native build, so we skip
# `wayland-android` entirely — its freedesktop submodule chain
# (cairo, mesa-drm, fontconfig, libinput) goes through
# gitlab.freedesktop.org which intermittently 5xxs and breaks
# this job for non-test reasons. The build job below still does
# the full recursive init.
- uses: ./.github/actions/init-submodules-with-retry
with:
paths: |
termlib
mosh-kotlin
et-kotlin
spice-kotlin
reticulum-kt
rnsh-kt
build-proot/proot-termux
prns
- uses: ./.github/actions/setup-toolchain
- name: Run release unit tests
run: ./gradlew testDebugUnitTest -PskipWaylandNatives=true -PskipFfmpegNatives=true
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
# One signed APK + AAB per ABI in parallel — roughly halves wall time vs
# running all four Gradle tasks sequentially in a single job.
#
# `needs: [verify-ci, test]` with `if: !cancelled() && (test skipped OR
# test succeeded)` lets build proceed when CI has already greenlit the
# SHA (test was skipped) or when a fresh test run passes.
build:
needs: [verify-ci, test]
if: |
!cancelled() &&
(needs.verify-ci.outputs.ci-passed == 'true' || needs.test.result == 'success')
# Free 4-core runner — arm64 + x64 build jobs run in parallel (matrix).
# Paid larger-tier runners silently queue forever once the Actions
# spending cap is hit, so we use the free tier and eat the extra build
# time. Timeout is generous to allow the full Rust/Go/Gradle compile
# on 4 cores (observed: ~60 min per ABI worst-case).
runs-on: ubuntu-latest
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
include:
- { abi: arm64, variant: Arm64 }
- { abi: x64, variant: X64 }
- { abi: armv7, variant: Armv7 }
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: false
- uses: ./.github/actions/init-submodules-with-retry
- uses: ./.github/actions/setup-toolchain
- name: Decode release keystore
run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > haven-release.jks
# -PtargetAbi lets core/wayland's buildWaylandNatives skip on the ABIs it
# has no binaries for. The five wayland natives are arm64-v8a only, so the
# x64 and armv7 jobs would otherwise spend ~20 minutes each building
# libraries they never package (#493).
# Both flavours ship from GitHub: `full` is the complete app and the
# only one F-Droid builds, `terminal` drops the desktop and media
# native payload for a ~20 MB smaller download (#510). The AAB stays
# full-only — it exists for store distribution, which the stripped
# flavour is not part of.
# The MEMSAMPLE loop prints host memory every 30s alongside the Gradle
# output. The v5.87.36 release attempts died five times in a row with
# "runner has received a shutdown signal" 26-31 min in (mid-minify) and
# nothing in the log to attribute it; this puts the ground truth in the
# log up to the moment of death, since evicted runners upload nothing
# afterwards.
- name: Build signed APK + AAB (${{ matrix.abi }})
run: |
( while true; do
echo "MEMSAMPLE $(date -u +%H:%M:%S) $(free -m | awk '/^Mem:/{print "used="$3"M avail="$7"M"}')"
sleep 30
done ) &
MEMSAMPLER=$!
# The two flavours run as SEQUENTIAL Gradle invocations, not one.
# With both in a single invocation, the terminal flavour's R8 ran
# concurrently with the full flavour's bundling/signing, and that
# overlap is where both armv7 host-OOM deaths sat (MEMSAMPLE showed
# 15.2G used of ~16G, 625M available at the kill). One R8/bundle
# peak at a time keeps the host inside its memory.
set +e
./gradlew :app:assemble${{ matrix.variant }}FullRelease \
:app:bundle${{ matrix.variant }}FullRelease \
-PtargetAbi=${{ matrix.abi }}
rc=$?
if [ "$rc" = "0" ]; then
# Restart the daemons between the flavours. A Gradle daemon never
# returns grown heap to the OS, so after the full flavour the host
# sat at ~14.6G used and the terminal flavour's R8/lintVital spike
# (15.65G used, 335M available, samples logging late = thrashing)
# killed the arm64 and armv7 runners even with the flavours
# serialized. A fresh daemon starts small and the terminal flavour
# compiles mostly from cache. The Kotlin daemon outlives --stop on
# its own idle timer, so it is killed explicitly.
./gradlew --stop
pkill -f KotlinCompileDaemon || true
sleep 5
./gradlew :app:assemble${{ matrix.variant }}TerminalRelease \
-PtargetAbi=${{ matrix.abi }}
rc=$?
fi
kill "$MEMSAMPLER" 2>/dev/null
exit "$rc"
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
# R8 reflective-class survival check — moved here from CI's per-push
# release-r8-smoke job (which now runs on PRs only). This release build
# already ran R8 (minify), so the assert is free here and guarantees
# every published release is checked even on direct-to-main pushes.
# ABI-agnostic (inspects the R8 mapping), so run it once on arm64.
- name: Assert reflectively-loaded classes survived R8
if: matrix.abi == 'arm64'
run: ./scripts/check-r8-kept-classes.sh
# A stale committed .so fails to dlopen on-device and kills every
# cage/app-window feature (#469), with nothing failing at build time.
# Inspects checked-in binaries only, so run it once.
- name: Assert committed native libs resolve their stubs (#469)
if: matrix.abi == 'arm64'
run: ./scripts/check-native-libs.sh
- name: Upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: haven-${{ matrix.abi }}-release
path: |
app/build/outputs/apk/${{ matrix.abi }}Full/release/haven-*-release.apk
app/build/outputs/apk/${{ matrix.abi }}Terminal/release/haven-*-terminal-release.apk
app/build/outputs/bundle/${{ matrix.abi }}FullRelease/*.aab
if-no-files-found: error
retention-days: 7
# Aggregate both ABIs onto a single GitHub release. Splitting this from
# build lets the per-ABI jobs run in parallel while the release step
# still sees every artifact.
publish:
needs: build
# Must name a status function explicitly. With a bare `if: startsWith(...)`,
# GitHub applies an implicit success() over the whole dependency GRAPH — and
# once verify-ci greenlights the SHA, `test` is skipped, which makes that
# implicit success() false and silently skips publish (nothing ships). `build`
# already guards itself this way; publish must too. This path only became
# reachable when verify-ci started skipping `test` for the first time.
if: |
!cancelled() && needs.build.result == 'success' &&
startsWith(github.ref, 'refs/tags/')
# Publish is just artifact download + GitHub Release upload — no heavy
# compile work. Keep on the free 4-core runner to avoid spending larger-
# runner minutes on ~20 seconds of I/O.
runs-on: ubuntu-latest
timeout-minutes: 10
# Reviewer-gated: the `signing` Environment (configured in repo settings
# with a required reviewer + v*/main restriction) must approve before the
# release is published, so no single account can ship unilaterally.
environment: signing
permissions:
contents: write # create the GitHub Release + upload assets
id-token: write # OIDC for build-provenance attestation
attestations: write # write the provenance attestation
steps:
# First — checkout runs `git clean`, so it must precede the artifact
# downloads or it would wipe release/. Provides CHANGELOG.md + the
# extractor script (each job runs on a fresh runner).
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: false
- name: Download arm64 artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: haven-arm64-release
path: release/
- name: Download x64 artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: haven-x64-release
path: release/
- name: Download armv7 artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: haven-armv7-release
path: release/
# Cryptographically tie each binary to this repo + commit + workflow so
# downstreams (F-Droid, users) can verify provenance with `gh attestation
# verify <file> --repo GlassHaven/Haven`.
- name: Attest build provenance
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
with:
subject-path: |
release/**/*.apk
release/**/*.aab
# Publish a flat checksum manifest alongside the assets (asset names are
# basenames once on the release, so the manifest uses basenames too).
- name: Generate SHA256SUMS
run: |
: > SHA256SUMS
find release -type f \( -name '*.apk' -o -name '*.aab' \) | sort | while read -r f; do
printf '%s %s\n' "$(sha256sum "$f" | cut -d' ' -f1)" "$(basename "$f")" >> SHA256SUMS
done
cat SHA256SUMS
# The notes for this tag must already exist in CHANGELOG.md (CI lint
# enforces it at version-bump time). Extract that section as the release
# body; generate_release_notes still appends the "Full Changelog" link.
- name: Extract release notes from CHANGELOG.md
run: ./scripts/check-changelog.sh extract "${GITHUB_REF_NAME}" > RELEASE_NOTES.md
# #514: someone asked what the "terminal" APKs are, which means the release
# page was not answering it. Appended to every release rather than left to
# a changelog entry nobody scrolls back to, or an issue nobody finds.
- name: Append the which-APK guide
run: |
cat >> RELEASE_NOTES.md <<'GUIDE'
---
### Which APK?
**`haven-<version>-<abi>-release.apk`** — the full app, and what F-Droid
carries. If in doubt, take this one.
**`haven-<version>-<abi>-terminal-release.apk`** — the same app with the
desktop and media parts left out, for people who only use Haven for SSH,
terminals, files and storage. Less than half the size on arm64. It drops
RDP and SPICE remote desktop, the native Wayland desktop, and ffmpeg — so
no media conversion, and no video previews or streaming in the file
browser. VNC is kept, so a Linux desktop running inside Haven's guest
still works.
Both are signed with the same key and carry the same version number, so
you can install either over the other without losing connections, keys or
your Linux guest. The shared version number does mean an updater will not
offer to move you between them — switching is a deliberate download.
`<abi>` is your device's CPU: `arm64` for essentially every modern phone,
`armv7` for older 32-bit devices, `x64` for emulators.
GUIDE
- name: Create GitHub Release
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
with:
body_path: RELEASE_NOTES.md
generate_release_notes: true
files: |
release/**/*.apk
release/**/*.aab
SHA256SUMS