From f7793bc908292df6296c40a7a24acc16c170fd44 Mon Sep 17 00:00:00 2001 From: Christoph Brandau Date: Thu, 23 Jul 2026 17:03:57 +0200 Subject: [PATCH] refactor(ci): Streamline package building workflow The CI/CD pipeline has been significantly refactored to improve efficiency and reduce dependency on Docker containers during the build process. The core logic now uses temporary directories and direct execution commands, streamlining both the packaging of tarballs and the generation of the repository database. This change results in a faster and more robust build environment within the runner. - Removed reliance on docker run for package building - Simplified the mechanism for updating the pacman repository database - Added necessary dependencies to base system installation steps --- .gitea/workflows/app_builder.yaml | 39 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/.gitea/workflows/app_builder.yaml b/.gitea/workflows/app_builder.yaml index a3af6f4..b1b327c 100644 --- a/.gitea/workflows/app_builder.yaml +++ b/.gitea/workflows/app_builder.yaml @@ -175,7 +175,7 @@ jobs: working-directory: / run: | pacman -Syu --noconfirm - pacman -S --needed --noconfirm nodejs npm git docker + pacman -S --needed --noconfirm nodejs npm git - uses: actions/checkout@v5 with: @@ -201,30 +201,29 @@ jobs: - name: Build pkg.tar.zst with PKGBUILD run: | + pacman -S --needed --noconfirm \ + base-devel git nodejs npm rust \ + webkit2gtk-4.1 gtk3 hicolor-icon-theme \ + libappindicator-gtk3 librsvg xdotool + mkdir -p arch-output - docker run --rm \ - -v "$PWD:/source:ro" \ - -v "$PWD/arch-output:/output" \ - archlinux:base-devel bash -lc ' - pacman -Syu --noconfirm git nodejs npm rust webkit2gtk-4.1 gtk3 hicolor-icon-theme libappindicator-gtk3 librsvg xdotool && - useradd --create-home builder && - cp -a /source /build && - chown -R builder:builder /build && - runuser -u builder -- bash -lc "cd /build && makepkg --cleanbuild --noconfirm" && - cp /build/*.pkg.tar.zst /output/ && - chmod 0644 /output/*.pkg.tar.zst - ' + + BUILD_ROOT="$(mktemp -d)" + cp -a . "$BUILD_ROOT/source" + + useradd --create-home builder + chown -R builder:builder "$BUILD_ROOT/source" + + runuser -u builder -- \ + bash -lc "cd '$BUILD_ROOT/source' && makepkg --cleanbuild --noconfirm" + + cp "$BUILD_ROOT"/source/*.pkg.tar.zst arch-output/ + chmod 0644 arch-output/*.pkg.tar.zst - name: Update pacman repository database run: | mkdir -p arch-repo - docker run --rm \ - -v "$PWD/arch-output:/packages:ro" \ - -v "$PWD/arch-repo:/repo" \ - archlinux:base-devel bash -lc ' - cd /repo && - repo-add gitty.db.tar.gz /packages/*.pkg.tar.zst - ' + repo-add arch-repo/gitty.db.tar.gz arch-output/*.pkg.tar.zst - name: Upload package and repository database to CDN working-directory: GitLite/cicd_tool