diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 83b1643..789a406 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -43,14 +43,22 @@ jobs: - name: Build Arch package run: | - # Build the package inside an Arch Linux container - # (PKGBUILD detects build/converge as pre-built binary) - echo "Workspace: ${{ github.workspace }}" - docker run --rm \ - -v "${{ github.workspace }}:${{ github.workspace }}" \ - -w "${{ github.workspace }}" \ - archlinux:latest \ - bash -c "pacman -Syu --noconfirm && pacman -S --noconfirm git fakeroot debugedit && echo '=== before useradd ===' && ls -la PKGBUILD && useradd -m build && echo '=== chmod+chown ===' && chmod -R a+rwX . && chown -R build:build . && echo '=== as root ===' && ls -la PKGBUILD && echo '=== as build ===' && runuser -u build -- ls -la PKGBUILD && runuser -u build -- makepkg --noconfirm --nodeps --nocheck" + # Build the package inside an Arch Linux container. + # Pipe workspace via stdin to avoid Docker-in-Docker volume mount issues. + # Output package via stdout as a tar to avoid capture conflicts. + tar cf - --exclude=.stack-root --exclude=.stack-work . | \ + docker run --rm -i -w /build archlinux:latest bash -c " + mkdir -p /build && + cd /build && + tar xf - && + pacman -Syu --noconfirm >&2 && + pacman -S --noconfirm git fakeroot debugedit >&2 && + useradd -m build && + chown -R build:build . && + runuser -u build -- makepkg --noconfirm --nodeps --nocheck >&2 && + tar cf /dev/stdout converge-*.pkg.tar.zst + " > /tmp/packages.tar 2>/dev/null + tar xf /tmp/packages.tar echo "pkgfile=$(ls converge-*.pkg.tar.zst)" >> "$GITHUB_ENV" - name: Publish to Arch repo