fix(release): build RPM directly on ubuntu runner without Docker
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:
@@ -171,30 +171,21 @@ jobs:
|
||||
set -euo pipefail
|
||||
VERSION="${{ github.event.inputs.tag || github.ref_name }}"
|
||||
PKGVER="${VERSION#v}"
|
||||
GO_ROOT="$(go env GOROOT)"
|
||||
|
||||
sudo apt-get install -y rpm
|
||||
|
||||
git archive --format=tar.gz --prefix=pgtidy-${PKGVER}/ HEAD \
|
||||
> pgtidy-${PKGVER}.tar.gz
|
||||
|
||||
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
|
||||
docker run --rm \
|
||||
-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/ \;
|
||||
"
|
||||
find ~/rpmbuild/RPMS/ -name '*.rpm' -exec cp {} rpm-out/ \;
|
||||
|
||||
- name: Upload to release
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user