chore(release): update package version to 0.0.4 and fix build paths
Some checks failed
Release / pkg-deb (push) Successful in -30m35s
Release / pkg-aur (push) Successful in -30m17s
Release / pkg-rpm (push) Failing after -29m39s
Release / test (push) Successful in -30m39s
Release / release (push) Successful in -30m33s

* Adjust pkgver in PKGBUILD to 0.0.4
* Update build paths in PKGBUILD for consistency
* Enhance AUR package versioning logic in release workflow
This commit is contained in:
Hein
2026-04-08 17:50:15 +02:00
parent 9ef31866f1
commit c6198ea6b7
2 changed files with 58 additions and 18 deletions

View File

@@ -146,12 +146,31 @@ jobs:
GIT_SSH_COMMAND="ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes -o UserKnownHostsFile=$AUR_KNOWN_HOSTS -i $AUR_KEY_PATH" \ GIT_SSH_COMMAND="ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes -o UserKnownHostsFile=$AUR_KNOWN_HOSTS -i $AUR_KEY_PATH" \
git clone ssh://aur@aur.archlinux.org/unitdore.git aur-repo git clone ssh://aur@aur.archlinux.org/unitdore.git aur-repo
# Compute SHA256 of the release tarball (same URL the PKGBUILD will download) CURRENT_PKGVER=$(awk -F= '/^pkgver=/ {print $2; exit}' aur-repo/PKGBUILD | tr -d "[:space:]")
CURRENT_PKGREL=$(awk -F= '/^pkgrel=/ {print $2; exit}' aur-repo/PKGBUILD | tr -d "[:space:]")
if [ "$CURRENT_PKGVER" = "$PKGVER" ]; then
case "$CURRENT_PKGREL" in
''|*[!0-9]*)
echo "Unsupported pkgrel in AUR repo: ${CURRENT_PKGREL}"
exit 1
;;
*)
PKGREL=$((CURRENT_PKGREL + 1))
;;
esac
else
PKGREL=1
fi
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/archive/v${PKGVER}.zip" | sha256sum | cut -d' ' -f1)
# Update PKGBUILD — keep remote source URL, only bump version and checksum # Update PKGBUILD — keep remote source URL, bump version/checksum, and increment pkgrel for same-version rebuilds.
sed -e "s/^pkgver=.*/pkgver=${PKGVER}/" \ sed -e "s/^pkgver=.*/pkgver=${PKGVER}/" \
-e "s/^pkgrel=.*/pkgrel=1/" \ -e "s/^pkgrel=.*/pkgrel=${PKGREL}/" \
-e "s/^sha256sums=.*/sha256sums=('${SHA}')/" \ -e "s/^sha256sums=.*/sha256sums=('${SHA}')/" \
pkg/arch/PKGBUILD > aur-repo/PKGBUILD pkg/arch/PKGBUILD > aur-repo/PKGBUILD
@@ -172,7 +191,7 @@ jobs:
git config user.email "hein@warky.dev" git config user.email "hein@warky.dev"
git config user.name "Hein" git config user.name "Hein"
git add PKGBUILD .SRCINFO git add PKGBUILD .SRCINFO
git commit -m "Update to v${PKGVER}" git commit -m "Update to v${PKGVER}-${PKGREL}"
GIT_SSH_COMMAND="ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes -o UserKnownHostsFile=$AUR_KNOWN_HOSTS -i $AUR_KEY_PATH" \ GIT_SSH_COMMAND="ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes -o UserKnownHostsFile=$AUR_KNOWN_HOSTS -i $AUR_KEY_PATH" \
git push origin HEAD:master git push origin HEAD:master
@@ -243,8 +262,16 @@ jobs:
- name: Build RPM - name: Build RPM
run: | run: |
set -euo pipefail
VERSION="${{ github.event.inputs.tag || github.ref_name }}" VERSION="${{ github.event.inputs.tag || github.ref_name }}"
PKGVER="${VERSION#v}" PKGVER="${VERSION#v}"
GO_VER="$(awk '/^go / { print $2; exit }' go.mod)"
if [ -z "${GO_VER}" ]; then
echo "Failed to determine Go version from go.mod"
exit 1
fi
# Source tarball — prefix=unitdore-VERSION/ matches RPM %autosetup convention # Source tarball — prefix=unitdore-VERSION/ matches RPM %autosetup convention
git archive --format=tar.gz --prefix=unitdore-${PKGVER}/ HEAD \ git archive --format=tar.gz --prefix=unitdore-${PKGVER}/ HEAD \
@@ -254,23 +281,37 @@ jobs:
sed -i "s/^Version:.*/Version: ${PKGVER}/" pkg/centos/unitdore.spec sed -i "s/^Version:.*/Version: ${PKGVER}/" pkg/centos/unitdore.spec
mkdir -p pkg/centos/out mkdir -p pkg/centos/out
docker run --rm \ CID=$(docker create \
-v "$PWD:/workspace" \ -e GO_VER="${GO_VER}" \
-v "$PWD/pkg/centos/out:/out" \ -e PKGVER="${PKGVER}" \
-w /workspace \ -w /build \
rockylinux:9 \ rockylinux:9 \
bash -c " bash -lc "
set -euo pipefail
# Rocky 9 images already ship curl-minimal, which is enough for the Go tarball download. # Rocky 9 images already ship curl-minimal, which is enough for the Go tarball download.
dnf install -y rpm-build git && dnf install -y rpm-build git &&
GO_VER=\$(grep '^go ' /workspace/go.mod | awk '{print \$2}') &&
curl -fsSL https://go.dev/dl/go\${GO_VER}.linux-amd64.tar.gz | tar -C /usr/local -xz && curl -fsSL https://go.dev/dl/go\${GO_VER}.linux-amd64.tar.gz | tar -C /usr/local -xz &&
export PATH=\$PATH:/usr/local/go/bin && export PATH=\$PATH:/usr/local/go/bin &&
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} && mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} &&
cp unitdore-${PKGVER}.tar.gz ~/rpmbuild/SOURCES/ && cp unitdore-${PKGVER}.tar.gz ~/rpmbuild/SOURCES/ &&
cp pkg/centos/unitdore.spec ~/rpmbuild/SPECS/ && cp pkg/centos/unitdore.spec ~/rpmbuild/SPECS/ &&
rpmbuild --nodeps -ba ~/rpmbuild/SPECS/unitdore.spec && rpmbuild --nodeps -ba ~/rpmbuild/SPECS/unitdore.spec
find ~/rpmbuild/RPMS -name '*.rpm' -exec cp {} /out/ \; ")
"
cleanup() {
docker rm -f "$CID" >/dev/null 2>&1 || true
}
trap cleanup EXIT
# Avoid bind mounts here because DinD runners may not expose the checkout path to the Docker daemon.
docker cp unitdore-${PKGVER}.tar.gz "$CID:/build/unitdore-${PKGVER}.tar.gz"
docker cp pkg "$CID:/build/pkg"
docker start -a "$CID"
docker cp "$CID:/root/rpmbuild/RPMS/." pkg/centos/out/
trap - EXIT
cleanup
- name: Upload to release - name: Upload to release
run: | run: |

View File

@@ -1,6 +1,6 @@
# Maintainer: Hein (Warky Devs) <hein@warky.dev> # Maintainer: Hein (Warky Devs) <hein@warky.dev>
pkgname=unitdore pkgname=unitdore
pkgver=0.1.0 pkgver=0.0.4
pkgrel=1 pkgrel=1
pkgdesc="A door you open and close for container units — manage containers via systemd" pkgdesc="A door you open and close for container units — manage containers via systemd"
arch=('x86_64' 'aarch64') arch=('x86_64' 'aarch64')
@@ -12,12 +12,11 @@ optdepends=(
'docker: Docker container runtime support' 'docker: Docker container runtime support'
) )
makedepends=('go') makedepends=('go')
backup=('etc/unitdore/units.yaml')
source=("$pkgname-$pkgver.zip::$url/archive/v$pkgver.zip") source=("$pkgname-$pkgver.zip::$url/archive/v$pkgver.zip")
sha256sums=('SKIP') sha256sums=('SKIP')
build() { build() {
cd "$pkgname-v$pkgver" cd "$pkgname"
export CGO_ENABLED=0 export CGO_ENABLED=0
go build \ go build \
-trimpath \ -trimpath \
@@ -26,12 +25,12 @@ build() {
} }
check() { check() {
cd "$pkgname-v$pkgver" cd "$pkgname"
go test ./... go test ./...
} }
package() { package() {
cd "$pkgname-v$pkgver" cd "$pkgname"
# Binary # Binary
install -Dm755 "$pkgname" "$pkgdir/usr/bin/$pkgname" install -Dm755 "$pkgname" "$pkgdir/usr/bin/$pkgname"