fix(release): build RPM directly on ubuntu runner without Docker
CI / Test (push) Successful in 27s
CI / Build (push) Successful in 25s

Docker volume mounts in Gitea CI don't expose the runner workspace
correctly, leaving /build empty inside the container. Since the pgtidy
binary is statically linked Go with no shared-lib deps, rpmbuild runs
fine on ubuntu-latest with the rpm package. Drops Docker entirely from
the RPM job.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-29 15:53:39 +02:00
co-authored by Claude Sonnet 4.6
parent b159f1bfb3
commit cd710a3e63
+8 -17
View File
@@ -171,30 +171,21 @@ jobs:
set -euo pipefail 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_ROOT="$(go env GOROOT)"
sudo apt-get install -y rpm
git archive --format=tar.gz --prefix=pgtidy-${PKGVER}/ HEAD \ git archive --format=tar.gz --prefix=pgtidy-${PKGVER}/ HEAD \
> pgtidy-${PKGVER}.tar.gz > pgtidy-${PKGVER}.tar.gz
sed -i "s/^Version:.*/Version: ${PKGVER}/" linux/centos/pgtidy.spec sed -i "s/^Version:.*/Version: ${PKGVER}/" linux/centos/pgtidy.spec
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
cp pgtidy-${PKGVER}.tar.gz ~/rpmbuild/SOURCES/
cp linux/centos/pgtidy.spec ~/rpmbuild/SPECS/
rpmbuild --nodeps -ba ~/rpmbuild/SPECS/pgtidy.spec
mkdir -p rpm-out mkdir -p rpm-out
docker run --rm \ find ~/rpmbuild/RPMS/ -name '*.rpm' -exec cp {} rpm-out/ \;
-v "$(pwd):/build" \
-v "${GO_ROOT}:/usr/local/go:ro" \
-e PKGVER="${PKGVER}" \
-w /build \
rockylinux:9 \
bash -lc "
set -euo pipefail
export PATH=\$PATH:/usr/local/go/bin &&
dnf install -y rpm-build git &&
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} &&
cp pgtidy-${PKGVER}.tar.gz ~/rpmbuild/SOURCES/ &&
cp linux/centos/pgtidy.spec ~/rpmbuild/SPECS/ &&
rpmbuild --nodeps -ba ~/rpmbuild/SPECS/pgtidy.spec &&
find ~/rpmbuild/RPMS/ -name '*.rpm' -exec cp {} /build/rpm-out/ \;
"
- name: Upload to release - name: Upload to release
run: | run: |