fix(release): F-Droid's upload resumable alone, by content, and Forgejo asked again

Train's first release (31 Oct 2026) stopped twice after its tag was pushed:

- Forgejo answered 500 (a unique constraint) to the release: it enters a
  pushed tag in its releases itself, a moment after the push. Asked again a
  few seconds later, it makes the release of that entry.
- The F-Droid upload filled the halkyon.app server's disk: rsync compared by
  time, and this laptop's working folder, restored from the repository, had
  every APK anew, so all 1.9 GB went again. It compares by content now.

tool/with_signing_keys.sh fdroid [APK] runs tool/fdroid_repo.sh alone with
the index's key, for an upload that failed after its release was made, and
the script skips an APK the working folder holds already rather than adding
a second file of the same build, which fdroid refuses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-31 23:28:49 +01:00
commit d981747728
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -10,6 +10,11 @@
#
# tool/with_signing_keys.sh <app> [release.dart's arguments]
# tool/with_signing_keys.sh train minor --dry-run
# tool/with_signing_keys.sh fdroid [tool/fdroid_repo.sh's arguments]
#
# The last runs tool/fdroid_repo.sh alone, with the F-Droid index's key and its password
# only: to publish the repository again, or a release's APK whose upload failed after its
# release was made (build/release/<tag>/<apk>).
#
# Needs pass-cli, logged in (pass-cli login), and jq. Reads of the items take their IDs,
# their attachments' names and, but for a dry run, the field "Password", which goes
@ -24,13 +29,14 @@ fail() {
exit 1
}
[ $# -ge 1 ] || fail 'Usage: tool/with_signing_keys.sh <app> [release arguments]'
[ $# -ge 1 ] || fail 'Usage: tool/with_signing_keys.sh <app | fdroid> [arguments]'
app="$1"
shift
# Each app released (tool/src/release/apps.dart): the variable its keystore's path goes
# in (its AndroidSigning's keystoreVariable) and the item keeping it.
case "$app" in
fdroid) ;;
learn) app_variable=HALKYON_ANDROID_KEYSTORE app_item='Halkyon Learn – Android release keystore' ;;
train) app_variable=HALKYON_TRAIN_ANDROID_KEYSTORE app_item='Halkyon Train – Android release keystore' ;;
*) fail "No signing key known for $app." ;;
@ -88,6 +94,18 @@ forgejo_token() {
printf '%s' "$value"
}
if [ "$app" = fdroid ]; then
echo "▸ Fetching the F-Droid index's key from $vault"
fetch "$fdroid_item" fdroid-index.p12 "$keys/fdroid-index.p12"
export HALKYON_FDROID_KEYSTORE="$keys/fdroid-index.p12"
fdroid_password=$(password "$fdroid_item")
export HALKYON_FDROID_KEYSTORE_PASSWORD="$fdroid_password"
unset fdroid_password
status=0
tool/fdroid_repo.sh "$@" || status=$?
exit "$status"
fi
echo "▸ Fetching the signing keys from $vault"
fetch "$app_item" android-release.p12 "$keys/android-release.p12"
fetch "$fdroid_item" fdroid-index.p12 "$keys/fdroid-index.p12"