From f1f8cb5757665ac1f1163dc21b472e0ab0b4f618 Mon Sep 17 00:00:00 2001 From: Elias Kohout Date: Thu, 2 Apr 2026 04:15:52 +0200 Subject: [PATCH] fix: build Arch packages without archlinux container The Gitea runner is ARM64 and archlinux:latest has no ARM64 image. Drop the container entirely and build .pkg.tar.zst manually: cross-compile with Go and assemble the package archive directly, so no makepkg or Arch Linux toolchain is needed. Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/arch-publish.yml | 57 ++++++++++++++++++------------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/.gitea/workflows/arch-publish.yml b/.gitea/workflows/arch-publish.yml index d603f73..6eec14d 100644 --- a/.gitea/workflows/arch-publish.yml +++ b/.gitea/workflows/arch-publish.yml @@ -8,9 +8,6 @@ jobs: build-arch: runs-on: - ubuntu-24.04 - container: - image: archlinux:latest - options: --platform linux/amd64 strategy: matrix: include: @@ -20,42 +17,54 @@ jobs: pkgarch: aarch64 steps: - name: Install build dependencies - run: pacman -Syu --noconfirm git nodejs go base-devel curl + run: sudo apt-get update -qq && sudo apt-get install -y --no-install-recommends zstd curl + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: src/go.mod - name: Checkout repository uses: actions/checkout@v4 - - name: Create build user + - name: Build binary run: | - useradd -m build - echo "build ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers - chown -R build:build . + cd src + GOARCH=${{ matrix.goarch }} GOOS=linux GOTOOLCHAIN=auto \ + go build -ldflags="-s -w" -trimpath -o axolotl . - - name: Configure git safe directory - run: git config --global --add safe.directory "$PWD" - - - name: Prepare source + - name: Create package run: | pkgver=$(echo "${{ github.ref_name }}" | sed 's/^v//') pkgname="axolotl" + pkgrel=1 + pkgarch="${{ matrix.pkgarch }}" - sed -i "s/pkgver=.*/pkgver=$pkgver/" packaging/arch/PKGBUILD - sed -i "s/^arch=.*/arch=('${{ matrix.pkgarch }}')/" packaging/arch/PKGBUILD + pkgdir=$(mktemp -d)/pkg + mkdir -p "$pkgdir/usr/bin" + install -Dm755 src/axolotl "$pkgdir/usr/bin/axolotl" + ln -s axolotl "$pkgdir/usr/bin/ax" - git archive --format=tar.gz --prefix="$pkgname-$pkgver/" -o "packaging/arch/$pkgname-$pkgver.tar.gz" HEAD + size=$(du -sb "$pkgdir/usr" | awk '{print $1}') + cat > "$pkgdir/.PKGINFO" <> "$GITHUB_ENV" - name: Publish to Gitea Registry run: | - pkg_file=$(find $PWD/packaging/arch -name "*.pkg.tar.zst" -type f | head -1) curl --fail-with-body \ --user "${{ github.repository_owner }}:${{ secrets.ACCESS_TOKEN }}" \ - --upload-file "$pkg_file" \ + --upload-file "$PKG_FILE" \ "${{ github.server_url }}/api/packages/${{ github.repository_owner }}/arch/push"