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