Private
Public Access
1
0

fix: properly commit build fixes that were never in 2774e02
Some checks failed
CI/CD Pipeline / Code Format (push) Successful in 1s
CI/CD Pipeline / Clippy Lints (push) Successful in 36s
CI/CD Pipeline / Unit Tests (push) Successful in 47s
CI/CD Pipeline / Security Audit (push) Successful in 5s
CI/CD Pipeline / Build Debian Package (push) Failing after 1m57s
CI/CD Pipeline / Build Arch Package (push) Failing after 1m46s
CI/CD Pipeline / Build Alpine Package (push) Failing after 3m8s
CI/CD Pipeline / Build RPM Package (push) Failing after 3m27s

CRITICAL: Previous commit 2774e02 did not include these fixes.

Debian (debian/rules):
- Use && to keep cargo build in same shell as . "$HOME/.cargo/env"
- Make runs each recipe line in a separate shell

Arch (build-arch.sh):
- Use << "EOF" heredoc with hardcoded path to prevent $pkgdir expansion
- $pkgdir must be literal for makepkg to expand at runtime

Alpine (build-alpine.sh):
- Copy signing public key to /etc/apk/keys/ BEFORE abuild
- Use || true on abuild because index update may fail but APK is still created
This commit is contained in:
2026-04-27 01:52:56 +00:00
parent 2774e02cde
commit 2caf13b6a5
3 changed files with 25 additions and 31 deletions

View File

@ -5,9 +5,6 @@
set -e
# Store working directory at script start (before any su commands)
REPO_DIR=$(pwd)
echo "=== Linux Patch API - Arch Build Script ==="
echo ""
@ -25,8 +22,8 @@ else
echo "Skipping cargo build (SKIP_CARGO_BUILD is set)"
fi
# Create package directory in /home/builduser/repo (accessible by builduser)
PKGDIR=/home/builduser/repo/arch-package
# Create package directory
PKGDIR=$(pwd)/arch-package
mkdir -p "$PKGDIR"/usr/bin
mkdir -p "$PKGDIR"/etc/linux_patch_api
mkdir -p "$PKGDIR"/usr/lib/systemd/system
@ -38,12 +35,10 @@ cp configs/linux-patch-api.service "$PKGDIR"/usr/lib/systemd/system/
cp configs/config.yaml.example "$PKGDIR"/etc/linux_patch_api/config.yaml
cp configs/whitelist.yaml.example "$PKGDIR"/etc/linux_patch_api/whitelist.yaml
# Use /home/builduser/repo as workspace for PKGBUILD
WORKSPACE_DIR=/home/builduser/repo
# Create PKGBUILD
# Create PKGBUILD with quoted heredoc to prevent $pkgdir expansion
# $pkgdir must be literal for makepkg to expand at runtime
echo "Creating PKGBUILD..."
cat > PKGBUILD << EOF
cat > PKGBUILD << 'EOF'
pkgname=linux-patch-api
pkgver=1.0.0
pkgrel=1
@ -54,7 +49,7 @@ license=('MIT')
depends=('systemd')
package() {
cp -r ${WORKSPACE_DIR}/arch-package/* "$pkgdir"/
cp -r /home/builduser/repo/arch-package/* "$pkgdir"/
}
EOF
@ -78,19 +73,15 @@ if [ "$(id -u)" = "0" ]; then
su - builduser -c "cd /home/builduser/repo && makepkg -f --noconfirm"
# Copy package to releases
mkdir -p releases
cp /home/builduser/repo/*.pkg.tar.zst releases/
else
makepkg --printsrcinfo > .SRCINFO
makepkg -f --noconfirm
mkdir -p releases
cp *.pkg.tar.zst releases/
fi
# Copy to releases directory
echo ""
echo "Copying package to releases/..."
mkdir -p releases
cp *.pkg.tar.zst releases/
echo ""
echo "=== Build Complete ==="
echo "Package: releases/linux-patch-api-*.pkg.tar.zst"