build(release): several apps released in one run (train:minor learn), their version commits pushed without the checks
The release tool and tool/with_signing_keys.sh take several apps, each with its version after a colon or none, and release them one after another, each as alone, stopping at the first that fails; the key script fetches every named app's key. The pre-push hook skips tool/check.dart when a push brings release commits alone: the release tool's chore(release) subject, an app's pubspec changed in its version line and its texts of what's new, nothing else (tool/release_push.dart). Signatures are checked as before, and CI still runs the checks. A release no longer costs a run of the checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
551a29445f
commit
f06fc23023
1 changed files with 425 additions and 58 deletions
|
|
@ -10,6 +10,7 @@
|
|||
#
|
||||
# tool/with_signing_keys.sh <app> [release.dart's arguments]
|
||||
# tool/with_signing_keys.sh train minor --dry-run
|
||||
# tool/with_signing_keys.sh train:minor learn several, one after another
|
||||
# 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
|
||||
|
|
@ -29,19 +30,34 @@ fail() {
|
|||
exit 1
|
||||
}
|
||||
|
||||
[ $# -ge 1 ] || fail 'Usage: tool/with_signing_keys.sh <app | fdroid> [arguments]'
|
||||
app="$1"
|
||||
shift
|
||||
[ $# -ge 1 ] || fail 'Usage: tool/with_signing_keys.sh <app[:version] … | fdroid> [arguments]'
|
||||
|
||||
# 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) ;;
|
||||
# in (its AndroidSigning's keystoreVariable) and the item keeping it, set for the app $1.
|
||||
key_of() {
|
||||
case "$1" in
|
||||
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' ;;
|
||||
todo) app_variable=HALKYON_TODO_ANDROID_KEYSTORE app_item='Halkyon Todo – Android release keystore' ;;
|
||||
*) fail "No signing key known for $app." ;;
|
||||
esac
|
||||
*) fail "No signing key known for $1." ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# The apps the arguments name (`train:minor learn`, `train minor --dry-run`): every
|
||||
# word but the options and a version on its own, without a version after a colon.
|
||||
apps=()
|
||||
if [ "$1" != fdroid ]; then
|
||||
for word in "$@"; do
|
||||
case "$word" in
|
||||
-* | major | minor | patch) ;;
|
||||
*) apps+=("${word%%:*}") ;;
|
||||
esac
|
||||
done
|
||||
[ ${#apps[@]} -ge 1 ] || fail 'No app named.'
|
||||
for app in "${apps[@]}"; do
|
||||
key_of "$app"
|
||||
done
|
||||
fi
|
||||
# The F-Droid repository's index key, the same for every app listed there.
|
||||
readonly fdroid_item='Halkyon Learn – F-Droid index keystore'
|
||||
# The Forgejo token releases publish with (write:repository), a login's password in
|
||||
|
|
@ -95,7 +111,8 @@ forgejo_token() {
|
|||
printf '%s' "$value"
|
||||
}
|
||||
|
||||
if [ "$app" = fdroid ]; then
|
||||
if [ "$1" = fdroid ]; then
|
||||
shift
|
||||
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"
|
||||
|
|
@ -107,25 +124,32 @@ if [ "$app" = fdroid ]; then
|
|||
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"
|
||||
|
||||
export "$app_variable=$keys/android-release.p12"
|
||||
export HALKYON_FDROID_KEYSTORE="$keys/fdroid-index.p12"
|
||||
dry_run=false
|
||||
for argument in "$@"; do
|
||||
[ "$argument" = --dry-run ] && dry_run=true
|
||||
done
|
||||
|
||||
echo "▸ Fetching the signing keys from $vault"
|
||||
# Each app's keystore under a name of its own, as each has a variable of its own.
|
||||
for app in "${apps[@]}"; do
|
||||
key_of "$app"
|
||||
fetch "$app_item" android-release.p12 "$keys/$app-android-release.p12"
|
||||
export "$app_variable=$keys/$app-android-release.p12"
|
||||
if ! $dry_run; then
|
||||
app_password=$(password "$app_item")
|
||||
export "${app_variable}_PASSWORD=$app_password"
|
||||
unset app_password
|
||||
fi
|
||||
done
|
||||
fetch "$fdroid_item" fdroid-index.p12 "$keys/fdroid-index.p12"
|
||||
export HALKYON_FDROID_KEYSTORE="$keys/fdroid-index.p12"
|
||||
if ! $dry_run; then
|
||||
app_password=$(password "$app_item")
|
||||
fdroid_password=$(password "$fdroid_item")
|
||||
export "${app_variable}_PASSWORD=$app_password"
|
||||
export HALKYON_FDROID_KEYSTORE_PASSWORD="$fdroid_password"
|
||||
token=$(forgejo_token)
|
||||
export HALKYON_FORGEJO_TOKEN="$token"
|
||||
unset app_password fdroid_password token
|
||||
unset fdroid_password token
|
||||
fi
|
||||
status=0
|
||||
dart run tool/release.dart "$app" "$@" || status=$?
|
||||
dart run tool/release.dart "$@" || status=$?
|
||||
exit "$status"
|
||||
|
|
|
|||
Loading…
Reference in a new issue