Files
ax/.gitea/workflows/arch-publish.yml
Elias Kohout f1f8cb5757
Some checks failed
Build and Publish APK Package / build-apk (amd64, x86_64) (push) Failing after 0s
Build and Publish APK Package / build-apk (arm64, aarch64) (push) Failing after 0s
Build and Publish Arch Package / build-arch (amd64, x86_64) (push) Failing after 39s
Build and Publish Arch Package / build-arch (arm64, aarch64) (push) Failing after 24s
Build and Push Docker Container / build-and-push (push) Successful in 1m49s
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 <noreply@anthropic.com>
2026-04-02 04:15:52 +02:00

71 lines
2.1 KiB
YAML

name: Build and Publish Arch Package
on:
push:
tags:
- 'v*'
jobs:
build-arch:
runs-on:
- ubuntu-24.04
strategy:
matrix:
include:
- goarch: amd64
pkgarch: x86_64
- goarch: arm64
pkgarch: aarch64
steps:
- name: Install build dependencies
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: Build binary
run: |
cd src
GOARCH=${{ matrix.goarch }} GOOS=linux GOTOOLCHAIN=auto \
go build -ldflags="-s -w" -trimpath -o axolotl .
- name: Create package
run: |
pkgver=$(echo "${{ github.ref_name }}" | sed 's/^v//')
pkgname="axolotl"
pkgrel=1
pkgarch="${{ matrix.pkgarch }}"
pkgdir=$(mktemp -d)/pkg
mkdir -p "$pkgdir/usr/bin"
install -Dm755 src/axolotl "$pkgdir/usr/bin/axolotl"
ln -s axolotl "$pkgdir/usr/bin/ax"
size=$(du -sb "$pkgdir/usr" | awk '{print $1}')
cat > "$pkgdir/.PKGINFO" <<EOF
pkgname = $pkgname
pkgver = $pkgver-$pkgrel
pkgdesc = CLI-native issue tracker using SQLite
url = https://g.eliaskohout.de/eliaskohout/axolotl
builddate = $(date +%s)
packager = Gitea Actions
size = $size
arch = $pkgarch
license = MIT
EOF
pkg_file="$PWD/${pkgname}-${pkgver}-${pkgrel}-${pkgarch}.pkg.tar.zst"
tar -C "$pkgdir" -c --zstd -f "$pkg_file" .
echo "PKG_FILE=$pkg_file" >> "$GITHUB_ENV"
- name: Publish to Gitea Registry
run: |
curl --fail-with-body \
--user "${{ github.repository_owner }}:${{ secrets.ACCESS_TOKEN }}" \
--upload-file "$PKG_FILE" \
"${{ github.server_url }}/api/packages/${{ github.repository_owner }}/arch/push"