From cc4829046df0501b10e0260d0b185e7570e09cb8 Mon Sep 17 00:00:00 2001 From: Hein Date: Mon, 12 Oct 2026 18:27:53 +0200 Subject: [PATCH] ci(release): attach source archives to release and use them for AUR package Gitea's /archive/ endpoint is disabled, which broke the AUR source download. Build source tar.gz/zip with git archive, upload as release assets, and point the PKGBUILD and checksum step at the release asset. --- .gitea/workflows/release.yml | 9 ++++++++- pkg/arch/PKGBUILD | 8 ++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 2bbb184..23936f4 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -53,6 +53,13 @@ jobs: echo "Built $NAME" done + - name: Build source archives + run: | + TAG="${{ github.event.inputs.tag || github.ref_name }}" + PREFIX="unitdore-${TAG#v}" + git archive --format=tar.gz --prefix="${PREFIX}/" -o "unitdore-${TAG}-source.tar.gz" "$TAG" + git archive --format=zip --prefix="${PREFIX}/" -o "unitdore-${TAG}-source.zip" "$TAG" + - name: Create release and upload assets run: | TAG="${{ github.event.inputs.tag || github.ref_name }}" @@ -166,7 +173,7 @@ jobs: echo "Publishing AUR package version ${PKGVER}-${PKGREL}" # Compute SHA256 of the source archive from the same URL the PKGBUILD will download. - SHA=$(curl -fsSL "https://git.warky.dev/wdevs/unitdore/archive/v${PKGVER}.zip" | sha256sum | cut -d' ' -f1) + SHA=$(curl -fsSL "https://git.warky.dev/wdevs/unitdore/releases/download/v${PKGVER}/unitdore-v${PKGVER}-source.zip" | sha256sum | cut -d' ' -f1) # Update PKGBUILD — keep remote source URL, bump version/checksum, and increment pkgrel for same-version rebuilds. sed -e "s/^pkgver=.*/pkgver=${PKGVER}/" \ diff --git a/pkg/arch/PKGBUILD b/pkg/arch/PKGBUILD index aff60f9..f18265f 100644 --- a/pkg/arch/PKGBUILD +++ b/pkg/arch/PKGBUILD @@ -12,11 +12,11 @@ optdepends=( 'docker: Docker container runtime support' ) makedepends=('go') -source=("$pkgname-$pkgver.zip::$url/archive/v$pkgver.zip") +source=("$pkgname-$pkgver.zip::$url/releases/download/v$pkgver/$pkgname-v$pkgver-source.zip") sha256sums=('SKIP') build() { - cd "$pkgname" + cd "$pkgname-$pkgver" export CGO_ENABLED=0 go build \ -trimpath \ @@ -25,12 +25,12 @@ build() { } check() { - cd "$pkgname" + cd "$pkgname-$pkgver" go test ./... } package() { - cd "$pkgname" + cd "$pkgname-$pkgver" # Binary install -Dm755 "$pkgname" "$pkgdir/usr/bin/$pkgname"