5 Commits
Author SHA1 Message Date
warkanum 995760c4da chore(release): bump version to 0.0.2
CI / Test (push) Successful in 34s
CI / Build (push) Successful in 28s
Release / Release (push) Successful in 33s
Release / AUR package (push) Successful in 1m15s
Release / Test (push) Successful in 35s
Release / RPM package (push) Failing after 31s
Release / Debian packages (push) Successful in 46s
Release / VSCode Extension (push) Successful in 41s
Release / DataGrip Plugin (push) Successful in 2m37s
2026-06-29 16:35:53 +02:00
warkanumandClaude Sonnet 4.6 53f136b18d fix(release): build RPM from pre-compiled binary with injected version
CI / Test (push) Successful in 27s
CI / Build (push) Successful in 33s
rpmbuild's %build shell cannot reliably access the Go toolchain or
module cache, risking a 'dev' version string. Build the binary on the
runner (where setup-go is active) with the correct -X main.version
ldflags, then package it via rpmbuild as a binary-install RPM.

Spec changes: Source0/1 are now the binary and LICENSE; %install copies
them directly; removed %prep/%build; -bb instead of -ba (no source RPM).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 16:17:59 +02:00
warkanumandClaude Sonnet 4.6 cd710a3e63 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>
2026-06-29 15:53:39 +02:00
warkanumandClaude Sonnet 4.6 b159f1bfb3 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>
2026-06-29 15:47:58 +02:00
warkanumandClaude Sonnet 4.6 e6ebb013d2 fix(release): produce linux tarballs matching PKGBUILD source URLs
CI / Test (push) Successful in 29s
CI / Build (push) Successful in 31s
PKGBUILD expects pgtidy_${pkgver}_linux_{amd64,arm64}.tar.gz containing
the binary and LICENSE. The release job was only uploading plain binaries
(pgtidy-linux-amd64). Now creates tarballs alongside the plain binaries,
uploads both, and updates AUR SHA256 computation to use the tarballs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 15:46:53 +02:00
3 changed files with 38 additions and 43 deletions
+28 -24
View File
@@ -55,6 +55,14 @@ jobs:
-ldflags "-X main.version=${VERSION}" \ -ldflags "-X main.version=${VERSION}" \
-o "$NAME" ./cmd/pgtidy -o "$NAME" ./cmd/pgtidy
echo "Built $NAME ($(ls -lh "$NAME" | awk '{print $5}'))" echo "Built $NAME ($(ls -lh "$NAME" | awk '{print $5}'))"
if [ "$GOOS" = "linux" ]; then
PKGVER="${VERSION#v}"
TARNAME="pgtidy_${PKGVER}_${GOOS}_${GOARCH}.tar.gz"
cp "$NAME" pgtidy
tar czf "$TARNAME" pgtidy LICENSE
rm pgtidy
echo "Packed $TARNAME"
fi
done done
- name: Create release and upload binaries - name: Create release and upload binaries
@@ -85,7 +93,7 @@ jobs:
exit 1 exit 1
fi fi
for f in pgtidy-*; do for f in pgtidy-* pgtidy_*.tar.gz; do
echo "Uploading $f..." echo "Uploading $f..."
curl -sf -X POST "${UPLOAD_URL}?name=${f}" \ curl -sf -X POST "${UPLOAD_URL}?name=${f}" \
-H "Authorization: token ${GITHUB_TOKEN}" \ -H "Authorization: token ${GITHUB_TOKEN}" \
@@ -151,39 +159,35 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-go@v5
with: with:
fetch-depth: 0 go-version-file: go.mod
- name: Build RPM - name: Build RPM
run: | run: |
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_VER="$(awk '/^go / { print $2; exit }' go.mod)"
git archive --format=tar.gz --prefix=pgtidy-${PKGVER}/ HEAD \ sudo apt-get install -y rpm
> pgtidy-${PKGVER}.tar.gz
CGO_ENABLED=0 go build \
-trimpath \
-ldflags "-X main.version=${PKGVER}" \
-o pgtidy \
./cmd/pgtidy
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 ~/rpmbuild/SOURCES/pgtidy
cp LICENSE ~/rpmbuild/SOURCES/LICENSE
cp linux/centos/pgtidy.spec ~/rpmbuild/SPECS/
rpmbuild --nodeps -bb ~/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" \
-e GO_VER="${GO_VER}" \
-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 &&
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: |
@@ -266,8 +270,8 @@ jobs:
echo "Publishing pgtidy-bin ${PKGVER}-${PKGREL} to AUR" echo "Publishing pgtidy-bin ${PKGVER}-${PKGREL} to AUR"
SHA_AMD64=$(curl -fsSL "https://git.warky.dev/wdevs/pgtidy/releases/download/v${PKGVER}/pgtidy-linux-amd64" | sha256sum | cut -d' ' -f1) SHA_AMD64=$(curl -fsSL "https://git.warky.dev/wdevs/pgtidy/releases/download/v${PKGVER}/pgtidy_${PKGVER}_linux_amd64.tar.gz" | sha256sum | cut -d' ' -f1)
SHA_ARM64=$(curl -fsSL "https://git.warky.dev/wdevs/pgtidy/releases/download/v${PKGVER}/pgtidy-linux-arm64" | sha256sum | cut -d' ' -f1) SHA_ARM64=$(curl -fsSL "https://git.warky.dev/wdevs/pgtidy/releases/download/v${PKGVER}/pgtidy_${PKGVER}_linux_arm64.tar.gz" | sha256sum | cut -d' ' -f1)
sed -e "s/^pkgver=.*/pkgver=${PKGVER}/" \ sed -e "s/^pkgver=.*/pkgver=${PKGVER}/" \
-e "s/^pkgrel=.*/pkgrel=${PKGREL}/" \ -e "s/^pkgrel=.*/pkgrel=${PKGREL}/" \
+1 -1
View File
@@ -1,6 +1,6 @@
# Maintainer: Hein (Warky Devs) <hein@warky.dev> # Maintainer: Hein (Warky Devs) <hein@warky.dev>
pkgname=pgtidy-bin pkgname=pgtidy-bin
pkgver=0.0.1 pkgver=0.0.2
pkgrel=1 pkgrel=1
pkgdesc="PostgreSQL SQL formatter and linter" pkgdesc="PostgreSQL SQL formatter and linter"
arch=('x86_64' 'aarch64') arch=('x86_64' 'aarch64')
+9 -18
View File
@@ -1,13 +1,13 @@
Name: pgtidy Name: pgtidy
Version: 0.0.1 Version: 0.0.2
Release: 1%{?dist} Release: 1%{?dist}
Summary: PostgreSQL SQL formatter and linter Summary: PostgreSQL SQL formatter and linter
License: MIT License: MIT
URL: https://git.warky.dev/wdevs/pgtidy URL: https://git.warky.dev/wdevs/pgtidy
Source0: %{name}-%{version}.tar.gz Source0: pgtidy
Source1: LICENSE
BuildRequires: golang >= 1.26 ExclusiveArch: x86_64
%global debug_package %{nil} %global debug_package %{nil}
%define _debugsource_packages 0 %define _debugsource_packages 0
@@ -17,24 +17,15 @@ BuildRequires: golang >= 1.26
PgTidy formats and lints PostgreSQL SQL, enforcing a consistent style PgTidy formats and lints PostgreSQL SQL, enforcing a consistent style
for migrations, schemas, functions, procedures, and triggers. for migrations, schemas, functions, procedures, and triggers.
%prep
%autosetup
%build
export CGO_ENABLED=0
go build \
-trimpath \
-ldflags "-X main.version=%{version}" \
-o %{name} ./cmd/pgtidy
%install %install
install -Dm755 %{name} %{buildroot}%{_bindir}/%{name} install -Dm755 %{SOURCE0} %{buildroot}%{_bindir}/%{name}
install -Dm644 LICENSE %{buildroot}%{_licensedir}/%{name}/LICENSE mkdir -p %{buildroot}%{_datadir}/licenses/%{name}
install -m644 %{SOURCE1} %{buildroot}%{_datadir}/licenses/%{name}/LICENSE
%files %files
%license LICENSE
%{_bindir}/%{name} %{_bindir}/%{name}
%{_datadir}/licenses/%{name}/LICENSE
%changelog %changelog
* Sun Jun 29 2026 Hein (Warky Devs) <hein@warky.dev> - 0.1.0-1 * Sun Jun 29 2026 Hein (Warky Devs) <hein@warky.dev> - 0.0.1-1
- Initial package - Initial package