parallel CI package builds
Build Alpine Packages / preflight (push) Successful in 24s
Build Alpine Packages / build (gitea) (push) Successful in 18s
Build Alpine Packages / build (lavinmq) (push) Successful in 2m58s
Build Alpine Packages / build (seaweedfs) (push) Successful in 20m49s
Build Alpine Packages / build (greptimedb) (push) Successful in 1h12m54s
Build Alpine Packages / verify-and-publish (push) Failing after 20s

This commit is contained in:
Joachim Schlöffel
2026-09-28 19:24:22 +02:00
parent 96bd8a20e0
commit e838fe1269
3 changed files with 229 additions and 54 deletions
+1
View File
@@ -138,6 +138,7 @@ prepare() {
} >> "${GITHUB_ENV}"
fi
if [[ -n "${GITHUB_OUTPUT:-}" ]]; then
printf 'selected_packages=%s\n' "${ALPINE_PACKAGES}" >> "${GITHUB_OUTPUT}"
if [[ -n "${ALPINE_PACKAGES}" ]]; then
printf 'packages_selected=true\n' >> "${GITHUB_OUTPUT}"
else
+96
View File
@@ -0,0 +1,96 @@
#!/usr/bin/env bash
set -euo pipefail
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
repo_name="${ALPINE_REPO_NAME:-local}"
arches="${ALPINE_ARCHES:-x86_64 aarch64}"
artifact_root="${APK_CI_ARTIFACTS_DIR:-${repo_root}/packages/worker-artifacts}"
package_root="${APK_CI_PACKAGE_ROOT:-${repo_root}/packages/${repo_name}}"
keys_root="$(mktemp -d)"
cleanup() {
rm -rf "${keys_root}"
}
trap cleanup EXIT
require_command() {
command -v "$1" >/dev/null 2>&1 || {
printf 'missing required command: %s\n' "$1" >&2
exit 2
}
}
copy_key() {
local key="$1"
local destination="$2"
local digest
digest="$(sha256sum "${key}" | awk '{print $1}')"
cp "${key}" "${destination}/${digest}.rsa.pub"
}
require_command abuild-keygen
require_command abuild-sign
require_command apk
if [[ ! -d "${artifact_root}" ]]; then
printf 'missing worker artifacts directory: %s\n' "${artifact_root}" >&2
exit 1
fi
rm -rf "${package_root}"
mkdir -p "${package_root}" "${HOME}/.abuild"
if ! compgen -G "${HOME}/.abuild/*.rsa" > /dev/null; then
abuild-keygen -a -n
fi
shopt -s nullglob
merge_private_keys=("${HOME}"/.abuild/*.rsa)
merge_public_keys=("${HOME}"/.abuild/*.rsa.pub)
shopt -u nullglob
if [[ "${#merge_private_keys[@]}" -ne 1 || "${#merge_public_keys[@]}" -ne 1 ]]; then
printf 'expected exactly one merge signing key in %s/.abuild\n' "${HOME}" >&2
exit 1
fi
for arch in ${arches}; do
destination="${package_root}/${arch}"
keys_dir="${keys_root}/${arch}"
mkdir -p "${destination}"
while IFS= read -r -d '' apk; do
cp "${apk}" "${destination}/"
done < <(find "${artifact_root}" -type f -path "*/${arch}/*.apk" -print0)
shopt -s nullglob
apks=("${destination}"/*.apk)
shopt -u nullglob
if [[ "${#apks[@]}" -eq 0 ]]; then
rmdir "${destination}"
continue
fi
while IFS= read -r -d '' key; do
copy_key "${key}" "${destination}"
mkdir -p "${keys_dir}"
copy_key "${key}" "${keys_dir}"
done < <(find "${artifact_root}" -type f -path "*/${arch}/*.rsa.pub" -print0)
if ! compgen -G "${keys_dir}/*.rsa.pub" > /dev/null; then
printf 'missing worker signing key for %s artifacts\n' "${arch}" >&2
exit 1
fi
copy_key "${merge_public_keys[0]}" "${destination}"
(
cd "${destination}"
apk --keys-dir "${keys_dir}" index --rewrite-arch "${arch}" -o APKINDEX.tar.gz ./*.apk
abuild-sign -k "${merge_private_keys[0]}" APKINDEX.tar.gz
)
done
if ! compgen -G "${package_root}"/*/*.apk > /dev/null; then
printf 'no APK files found in worker artifacts: %s\n' "${artifact_root}" >&2
exit 1
fi