Compare commits

...
2 Commits
Author SHA1 Message Date
Joachim Schlöffel b329cd0ccc Document preserving Gitea Alpine key filename
Build Alpine Packages / build-and-publish (v3.23, 3.23) (push) Successful in 25m2s
2026-06-09 14:25:09 +02:00
Joachim Schlöffel ca64a3e993 Skip duplicate APK filenames when publishing 2026-06-09 13:43:50 +02:00
2 changed files with 22 additions and 4 deletions
+6 -2
View File
@@ -21,10 +21,14 @@ https://code.factoring.digital/api/packages/public/alpine/v3.23/alpine-packages
Install the registry signing key on each Alpine node:
```sh
curl -fsSLo /etc/apk/keys/public-alpine.rsa.pub \
https://code.factoring.digital/api/packages/public/alpine/key
cd /etc/apk/keys
curl -fsSLOJ https://code.factoring.digital/api/packages/public/alpine/key
```
Keep the filename returned by Gitea. Alpine matches repository signatures by key
filename, so saving the key under another name makes `apk update` report
`UNTRUSTED signature`.
Add the stable package repository:
```sh
+16 -2
View File
@@ -46,9 +46,23 @@ if [[ "${#apks[@]}" -eq 0 ]]; then
exit 1
fi
printf 'Publishing %d APK files to %s\n' "${#apks[@]}" "${upload_url}"
declare -A published_filenames=()
unique_apks=()
for apk in "${apks[@]}"; do
filename="$(basename "${apk}")"
if [[ -n "${published_filenames[${filename}]:-}" ]]; then
continue
fi
published_filenames["${filename}"]=1
unique_apks+=("${apk}")
done
printf 'Publishing %d APK files to %s\n' "${#unique_apks[@]}" "${upload_url}"
if [[ "${#unique_apks[@]}" -ne "${#apks[@]}" ]]; then
printf 'Skipping %d duplicate local APK filename(s)\n' "$((${#apks[@]} - ${#unique_apks[@]}))"
fi
for apk in "${unique_apks[@]}"; do
filename="$(basename "${apk}")"
status="$(
curl --silent --show-error --location \