Private
Public Access
1
0

fix: resolve all build job failures

CI workflow (ci.yml):
- Proper YAML structure for all steps
- curl+tar checkout (act runners lack git)
- GITEATOKEN authentication for private repo access
- build-essential/gcc added to all jobs
- dpkg-buildpackage -d flag (skip apt dep check)

Build scripts:
- build-alpine.sh: Copy APKBUILD to /home/builduser before abuild
- build-arch.sh: Use REPO_DIR variable instead of $(pwd) in su commands
This commit is contained in:
2026-04-27 00:37:51 +00:00
parent 3326fa4445
commit 3723d97427
3 changed files with 13 additions and 4 deletions

View File

@ -116,6 +116,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y build-essential debhelper pkg-config libsystemd-dev
- name: Build Debian package
run: |
sudo dpkg-buildpackage -us -uc -b -d
- name: Upload to Gitea Release
if: startsWith(github.ref, 'refs/tags/')

View File

@ -110,7 +110,11 @@ if [ "$(id -u)" = "0" ]; then
echo "PACKAGER_PRIVKEY=\"$KEYFILE\"" > /home/builduser/.abuild/abuild.conf
chown builduser:builduser /home/builduser/.abuild/abuild.conf
# Run abuild as builduser with explicit working directory
# Copy APKBUILD and checksums to builduser home for abuild
cp APKBUILD /home/builduser/
cp .checksums /home/builduser/ 2>/dev/null || true
# Run abuild as builduser in /home/builduser where APKBUILD exists
su - builduser -c "cd /home/builduser && abuild checksum && abuild -d -F"
# Copy APK from builduser packages to releases

View File

@ -5,6 +5,9 @@
set -e
# Store working directory at script start (before any su commands)
REPO_DIR=$(pwd)
echo "=== Linux Patch API - Arch Build Script ==="
echo ""
@ -61,13 +64,14 @@ echo "Creating .SRCINFO..."
# Build package
echo "Building Arch package..."
# For CI environments where we may run as root
# For CI environments where we may run as root
if [ "$(id -u)" = "0" ]; then
echo "Running as root - creating build user for makepkg..."
useradd -m builduser 2>/dev/null || true
chown -R builduser:builduser "$(pwd)"
su - builduser -c "cd $(pwd) && makepkg --printsrcinfo > .SRCINFO"
su - builduser -c "cd $(pwd) && makepkg -f --noconfirm"
chown -R builduser:builduser "$REPO_DIR"
su - builduser -c "cd $REPO_DIR && makepkg --printsrcinfo > .SRCINFO"
su - builduser -c "cd $REPO_DIR && makepkg -f --noconfirm"
else
makepkg --printsrcinfo > .SRCINFO
makepkg -f --noconfirm