fix(release): mount host Go into RPM container instead of downloading
CI / Test (push) Successful in 33s
CI / Build (push) Successful in 28s

go.mod specifies 'go 1.26' (no patch), making the download URL
go1.26.linux-amd64.tar.gz which 404s. Use actions/setup-go on the
runner and bind-mount GOROOT into the rockylinux container read-only,
removing the curl+tar download entirely.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-29 15:47:58 +02:00
parent e6ebb013d2
commit b159f1bfb3
+7 -4
View File
@@ -162,12 +162,16 @@ jobs:
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build RPM
run: |
set -euo pipefail
VERSION="${{ github.event.inputs.tag || github.ref_name }}"
PKGVER="${VERSION#v}"
GO_VER="$(awk '/^go / { print $2; exit }' go.mod)"
GO_ROOT="$(go env GOROOT)"
git archive --format=tar.gz --prefix=pgtidy-${PKGVER}/ HEAD \
> pgtidy-${PKGVER}.tar.gz
@@ -177,15 +181,14 @@ jobs:
mkdir -p rpm-out
docker run --rm \
-v "$(pwd):/build" \
-e GO_VER="${GO_VER}" \
-v "${GO_ROOT}:/usr/local/go:ro" \
-e PKGVER="${PKGVER}" \
-w /build \
rockylinux:9 \
bash -lc "
set -euo pipefail
dnf install -y rpm-build git &&
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 &&
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/ &&