Publish pacman packages with the version from PKGINFO

OpenArtifact validates the upload path against the full Arch package version. Keep the release assets as built and derive the registry filename, including its epoch, from the package metadata. Duplicate checks use the same URL.

Checked actionlint, Bash syntax and the upload paths for all four SHA-256-verified v1.0.1 Arch release assets.
This commit is contained in:
Aleksandr Bogomiakov committed 2026-11-24 21:44:03 +02:00
1 parent d72e8886d6
commit 01b51081c3
1 file changed
+8 -3
+8 -3
View File
@@ -455,9 +455,14 @@ jobs:
"$OA_SERVER/api/v1/repositories/hexor-apt/debs")
;;
*.pkg.tar.zst)
stem=${name%.pkg.tar.zst}
arch=${stem##*-}
url="$OA_SERVER/repos/hexor-pacman/os/$arch/$name"
# Release asset names omit the epoch. OpenArtifact matches the
# upload path against the full version recorded in .PKGINFO.
pkginfo=$(tar --zstd -xOf "$file" .PKGINFO)
pkg=$(sed -n 's/^pkgname = //p' <<< "$pkginfo")
version=$(sed -n 's/^pkgver = //p' <<< "$pkginfo")
arch=$(sed -n 's/^arch = //p' <<< "$pkginfo")
: "${pkg:?missing pkgname}" "${version:?missing pkgver}" "${arch:?missing arch}"
url="$OA_SERVER/repos/hexor-pacman/os/$arch/$pkg-$version-$arch.pkg.tar.zst"
status=$(curl -sS -o "$RUNNER_TEMP/oa-upload.json" -w '%{http_code}' \
"${auth[@]}" -T "$file" "$url")
;;