ci: use a Trafero-specific persistent CI keystore path

The runner cache already held a release.jks minted by another project with a different store password, so packageRelease failed with "keystore password was incorrect". Mint and reuse trafero-release.jks instead.
This commit is contained in:
nick committed 2026-09-21 18:02:14 +12:00
1 parent ef12660b6a
commit 42795751bc
2 files changed
+16 -12

No files matched your search

+11 -9
View File
@@ -82,25 +82,27 @@ jobs:
git checkout "$RELEASE_TAG" git checkout "$RELEASE_TAG"
# Persistent signing keystore: minted ONCE in the runner's # Persistent signing keystore: minted ONCE in the runner's
# cache dir (which survives across runs, same place the JDK # cache dir (which survives across runs, same place the JDK
# and SDK live) and copied into the checkout. Every release # and SDK live) and copied into the checkout. Trafero uses its
# is therefore signed with the SAME key, so users can # OWN file (trafero-release.jks) - the shared release.jks there
# upgrade in place instead of hitting a signature conflict. # was minted by another project with a different password.
# A runner-host rebuild would mint a fresh key — the only # Every release is therefore signed with the SAME key, so
# scenario that breaks one upgrade. # users can upgrade in place instead of hitting a signature
# conflict. A runner-host rebuild would mint a fresh key - the
# only scenario that breaks one upgrade.
mkdir -p keystore mkdir -p keystore
if [ ! -f /var/lib/gitea-runner/work/release.jks ]; then if [ ! -f /var/lib/gitea-runner/work/trafero-release.jks ]; then
echo "Minting new persistent CI keystore" echo "Minting new persistent CI keystore"
keytool -genkey -noprompt -v \ keytool -genkey -noprompt -v \
-keystore /var/lib/gitea-runner/work/release.jks \ -keystore /var/lib/gitea-runner/work/trafero-release.jks \
-keyalg RSA -keysize 2048 -validity 10000 \ -keyalg RSA -keysize 2048 -validity 10000 \
-alias trafero \ -alias trafero \
-storepass trafero_dev_keystore \ -storepass trafero_dev_keystore \
-keypass trafero_dev_keystore \ -keypass trafero_dev_keystore \
-dname "CN=Trafero Dev, OU=Local, O=Trafero, L=Local, ST=Local, C=NZ" -dname "CN=Trafero CI, OU=Local, O=Trafero, L=Local, ST=Local, C=NZ"
else else
echo "Reusing persistent CI keystore from runner cache" echo "Reusing persistent CI keystore from runner cache"
fi fi
cp /var/lib/gitea-runner/work/release.jks keystore/release.jks cp /var/lib/gitea-runner/work/trafero-release.jks keystore/release.jks
export JAVA_HOME=/var/lib/gitea-runner/work/jdk export JAVA_HOME=/var/lib/gitea-runner/work/jdk
export ANDROID_HOME=/var/lib/gitea-runner/work/android-sdk export ANDROID_HOME=/var/lib/gitea-runner/work/android-sdk
export PATH=$JAVA_HOME/bin:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$PATH export PATH=$JAVA_HOME/bin:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$PATH
+5 -3
View File
@@ -25,9 +25,11 @@ before publishing anywhere real.
## CI (Gitea Actions) ## CI (Gitea Actions)
`release.yml` mints one persistent keystore on the runner at `release.yml` mints one persistent keystore on the runner at
`/var/lib/gitea-runner/work/release.jks` (same parameters as above) and `/var/lib/gitea-runner/work/trafero-release.jks` (same parameters as
copies it to `keystore/release.jks` for every build, so all CI release above, except `CN=Trafero CI`) and copies it to `keystore/release.jks`
APKs share one signing key and users can upgrade in place. for every build, so all CI release APKs share one signing key and users
can upgrade in place. The file is project-specific (`trafero-` prefix)
because the runner cache directory is shared between repositories.
**Important:** locally-built (and debug) APKs have a *different* **Important:** locally-built (and debug) APKs have a *different*
signature from CI release APKs — installing a CI release build over a signature from CI release APKs — installing a CI release build over a