From 576080c8b5727f7a77a714c20edfda4eb14c9461 Mon Sep 17 00:00:00 2001 From: Incido Developer Date: Sun, 30 Aug 2026 11:02:50 +1200 Subject: [PATCH] ci(release): persist signing keystore in runner cache for stable signatures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The build step minted a fresh keystore inside the checkout on every run, so each CI release was signed with a different key. Upgrading from any previous release then failed with a signature conflict (INSTALL_FAILED_UPDATE_INCOMPATIBLE) — and with allowBackup=false, the only workaround was uninstalling, which destroys the user's notes. The keystore is now minted once in /tmp/gitea-runner-work (the same persistent cache that already holds the JDK and Android SDK) and copied into the checkout before building. Every release from now on shares one signing key, so in-place upgrades work. Only a runner-host rebuild would mint a new key (breaking exactly one upgrade). Note: v0.3.7.0 was signed with an ephemeral key that no longer exists, so the v0.3.7.0 -> v0.3.7.1 upgrade still requires a one-time uninstall (export a backup first). --- .gitea/workflows/release.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 3de0778..2f86415 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -58,16 +58,28 @@ jobs: run: | cd repo git checkout ${{ github.ref_name }} + # Persistent signing keystore: minted ONCE in the runner's + # cache dir (which survives across runs, same place the JDK + # and SDK live) and copied into the checkout. Every release + # is therefore signed with the SAME key, so users can + # upgrade in place instead of hitting a signature conflict + # (and, with allowBackup=false, losing their notes). + # A runner-host rebuild would mint a fresh key — the only + # scenario that breaks one upgrade. mkdir -p keystore - if [ ! -f keystore/release.jks ]; then + if [ ! -f /tmp/gitea-runner-work/release.jks ]; then + echo "Minting new persistent CI keystore" keytool -genkey -noprompt -v \ - -keystore keystore/release.jks \ + -keystore /tmp/gitea-runner-work/release.jks \ -keyalg RSA -keysize 2048 -validity 10000 \ -alias incido \ -storepass incido_dev_keystore \ -keypass incido_dev_keystore \ -dname "CN=Incido Dev, OU=Local, O=Incido, L=Local, ST=Local, C=NZ" + else + echo "Reusing persistent CI keystore from runner cache" fi + cp /tmp/gitea-runner-work/release.jks keystore/release.jks export JAVA_HOME=/tmp/gitea-runner-work/jdk export ANDROID_HOME=/tmp/gitea-runner-work/android-sdk export PATH=$JAVA_HOME/bin:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$PATH