10 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
warkanumandClaude Sonnet 4.6 27c2b9c002 fix(release): bump Node to 22 for pnpm v11 compatibility
CI / Test (push) Successful in 29s
CI / Build (push) Successful in 35s
pnpm v11 (latest) requires Node >= 22.13; Node 20 caused
ERR_UNKNOWN_BUILTIN_MODULE: node:sqlite on install.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 15:37:54 +02:00
warkanumandClaude Sonnet 4.6 05106ec368 fix(release): publish release immediately so AUR job can curl binaries
Draft releases return 404 on asset downloads, which breaks the AUR
SHA256 computation in pkg-aur. Remove draft:true so assets are publicly
accessible when downstream jobs run.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 15:37:10 +02:00
warkanumandClaude Sonnet 4.6 749b01bfa2 fix(release): guard PREV_TAG with rev-parse before using in log range
CI / Test (push) Successful in 28s
CI / Build (push) Successful in 25s
If PREV_TAG is a malformed or non-reachable tag name, git log fails
with exit 128 under set -e. Validate with git rev-parse --verify first
and fall back to a full log if it doesn't resolve.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 15:27:06 +02:00
warkanumandClaude Sonnet 4.6 249f1694ef fix(release): fix VSCode pnpm, RPM docker mount, and AUR empty repo
CI / Test (push) Successful in 27s
CI / Build (push) Successful in 25s
- VSCode: switch from npm ci to pnpm (project uses pnpm-lock.yaml)
- RPM: replace docker create+cp with docker run --rm -v mount to avoid
  missing /build directory in rockylinux:9
- AUR: guard PKGBUILD reads with -f check so first publish to an empty
  AUR repo defaults pkgrel to 1 instead of crashing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 15:17:18 +02:00
Hein cdcce94774 fix(release): update release notes generation logic
CI / Test (push) Successful in 25s
CI / Build (push) Successful in 23s
2026-06-29 13:07:55 +02:00
3 changed files with 56 additions and 61 deletions
+46 -42
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
@@ -64,12 +72,11 @@ jobs:
API="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases" API="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases"
PREV_TAG=$(git tag --sort=-version:refname | { grep -v "^${TAG}$" || true; } | head -1) PREV_TAG=$(git tag --sort=-version:refname | { grep -v "^${TAG}$" || true; } | head -1)
if [ -n "$PREV_TAG" ]; then if [ -n "$PREV_TAG" ] && git rev-parse --verify "${PREV_TAG}" >/dev/null 2>&1; then
RANGE="${PREV_TAG}..${TAG}" NOTES=$(git log "${PREV_TAG}..${TAG}" --pretty=format:"- %s" --no-merges)
else else
RANGE="HEAD~20..HEAD" NOTES=$(git log --pretty=format:"- %s" --no-merges)
fi fi
NOTES=$(git log "$RANGE" --pretty=format:"- %s" --no-merges)
BODY="## What's changed"$'\n'"${NOTES}" BODY="## What's changed"$'\n'"${NOTES}"
BODY_JSON=$(printf '%s' "$BODY" | python3 -c 'import json,sys; print(json.dumps(sys.stdin.read()))') BODY_JSON=$(printf '%s' "$BODY" | python3 -c 'import json,sys; print(json.dumps(sys.stdin.read()))')
@@ -77,7 +84,7 @@ jobs:
RELEASE=$(curl -s -X POST "$API" \ RELEASE=$(curl -s -X POST "$API" \
-H "Authorization: token ${GITHUB_TOKEN}" \ -H "Authorization: token ${GITHUB_TOKEN}" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d "{\"tag_name\":\"${TAG}\",\"name\":\"${TAG}\",\"body\":${BODY_JSON},\"draft\":true}") -d "{\"tag_name\":\"${TAG}\",\"name\":\"${TAG}\",\"body\":${BODY_JSON}}")
echo "API response: $RELEASE" echo "API response: $RELEASE"
UPLOAD_URL=$(echo "$RELEASE" | grep -o '"upload_url":"[^"]*"' | cut -d'"' -f4 | sed 's/{[^}]*}//') UPLOAD_URL=$(echo "$RELEASE" | grep -o '"upload_url":"[^"]*"' | cut -d'"' -f4 | sed 's/{[^}]*}//')
@@ -86,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}" \
@@ -152,47 +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
CID=$(docker create \ mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
-e GO_VER="${GO_VER}" \ cp pgtidy ~/rpmbuild/SOURCES/pgtidy
-e PKGVER="${PKGVER}" \ cp LICENSE ~/rpmbuild/SOURCES/LICENSE
-w /build \ cp linux/centos/pgtidy.spec ~/rpmbuild/SPECS/
rockylinux:9 \ rpmbuild --nodeps -bb ~/rpmbuild/SPECS/pgtidy.spec
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
")
cleanup() { docker rm -f "$CID" >/dev/null 2>&1 || true; }
trap cleanup EXIT
docker cp pgtidy-${PKGVER}.tar.gz "$CID:/build/"
docker cp linux "$CID:/build/linux"
docker start -a "$CID"
mkdir -p rpm-out mkdir -p rpm-out
docker cp "$CID:/root/rpmbuild/RPMS/." rpm-out/ find ~/rpmbuild/RPMS/ -name '*.rpm' -exec cp {} rpm-out/ \;
trap - EXIT; cleanup
- name: Upload to release - name: Upload to release
run: | run: |
@@ -259,8 +254,13 @@ 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/pgtidy-bin.git aur-repo git clone ssh://aur@aur.archlinux.org/pgtidy-bin.git aur-repo
CURRENT_PKGVER=$(awk -F= '/^pkgver=/ {print $2; exit}' aur-repo/PKGBUILD | tr -d "[:space:]") if [ -f aur-repo/PKGBUILD ]; then
CURRENT_PKGREL=$(awk -F= '/^pkgrel=/ {print $2; exit}' aur-repo/PKGBUILD | tr -d "[:space:]") 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:]")
else
CURRENT_PKGVER=""
CURRENT_PKGREL=0
fi
if [ "$CURRENT_PKGVER" = "$PKGVER" ]; then if [ "$CURRENT_PKGVER" = "$PKGVER" ]; then
PKGREL=$((CURRENT_PKGREL + 1)) PKGREL=$((CURRENT_PKGREL + 1))
@@ -270,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}/" \
@@ -312,14 +312,18 @@ jobs:
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version: '20' node-version: '22'
- uses: pnpm/action-setup@v4
with:
version: latest
- name: Install and package - name: Install and package
working-directory: editors/vscode working-directory: editors/vscode
run: | run: |
npm ci pnpm install --frozen-lockfile
npm run compile pnpm run compile
npm run package pnpm run package
- name: Upload to release - name: Upload to release
run: | run: |
+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