From c2f0dd70af4182cf4afcaf43243529078e6136d6 Mon Sep 17 00:00:00 2001 From: Echo Date: Tue, 14 Apr 2026 02:52:00 +0000 Subject: [PATCH] fix: Move abuild-keygen inside build-alpine.sh for same-shell key persistence --- build-alpine.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) mode change 100755 => 100644 build-alpine.sh diff --git a/build-alpine.sh b/build-alpine.sh old mode 100755 new mode 100644 index a36fc0c..d6e956f --- a/build-alpine.sh +++ b/build-alpine.sh @@ -15,12 +15,29 @@ fi # Check if running on Alpine +# Check if running on Alpine # Check if running on Alpine if ! command -v abuild &> /dev/null; then echo "Installing Alpine build tools..." apk add --no-cache alpine-sdk rust cargo openssl-dev openrc git fi +# Generate abuild signing keys (must be done in same shell session as abuild commands) +if [ ! -f /etc/abuild.conf ] || ! grep -q PACKAGER_PRIVKEY /etc/abuild.conf 2>/dev/null; then + echo "Generating abuild signing keys..." + apk add --no-cache abuild + abuild-keygen -a -n 2>&1 | tee /tmp/keygen.log + # Find the actual key file (handles missing username prefix) + KEYFILE=$(ls /root/.abuild/*.rsa 2>/dev/null | head -1) + if [ -z "$KEYFILE" ]; then + KEYFILE=$(ls /root/.abuild/-*.rsa 2>/dev/null | head -1) + fi + echo "Found key: $KEYFILE" + # Write directly to abuild.conf + echo "PACKAGER_PRIVKEY=\"$KEYFILE\"" >> /etc/abuild.conf + cat /etc/abuild.conf +fi + # Setup build environment echo "Setting up build environment..." export CBUILDROOT=$(pwd)/.abuild