From 01b51081c3129c6dfea2918ed66b2e0a56514656 Mon Sep 17 00:00:00 2001 From: Aleksandr Bogomiakov Date: Tue, 24 Nov 2026 21:44:03 +0200 Subject: [PATCH] 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. --- .github/workflows/release.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3b8c6c9..e60c4ad 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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") ;;