Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0863c110dd | ||
|
|
5939462f20 |
@@ -65,6 +65,13 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
- name: Build source archives
|
||||||
|
run: |
|
||||||
|
TAG="${{ github.event.inputs.tag || github.ref_name }}"
|
||||||
|
PREFIX="pgtidy-${TAG#v}"
|
||||||
|
git archive --format=tar.gz --prefix="${PREFIX}/" -o "pgtidy-${TAG}-source.tar.gz" "$TAG"
|
||||||
|
git archive --format=zip --prefix="${PREFIX}/" -o "pgtidy-${TAG}-source.zip" "$TAG"
|
||||||
|
|
||||||
- name: Create release and upload binaries
|
- name: Create release and upload binaries
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -255,9 +262,13 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
pkg-aur:
|
pkg-aur:
|
||||||
name: AUR package
|
name: AUR package (${{ matrix.pkg }})
|
||||||
needs: release
|
needs: release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
pkg: [pgtidy-bin, pgtidy]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -268,6 +279,7 @@ 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}"
|
||||||
|
PKG="${{ matrix.pkg }}"
|
||||||
AUR_KEY_PATH="$HOME/.ssh/aur"
|
AUR_KEY_PATH="$HOME/.ssh/aur"
|
||||||
AUR_KNOWN_HOSTS="$HOME/.ssh/known_hosts"
|
AUR_KNOWN_HOSTS="$HOME/.ssh/known_hosts"
|
||||||
|
|
||||||
@@ -299,7 +311,7 @@ jobs:
|
|||||||
chmod 644 "$AUR_KNOWN_HOSTS"
|
chmod 644 "$AUR_KNOWN_HOSTS"
|
||||||
|
|
||||||
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/${PKG}.git" aur-repo
|
||||||
|
|
||||||
if [ -f aur-repo/PKGBUILD ]; then
|
if [ -f aur-repo/PKGBUILD ]; then
|
||||||
CURRENT_PKGVER=$(awk -F= '/^pkgver=/ {print $2; exit}' aur-repo/PKGBUILD | tr -d "[:space:]")
|
CURRENT_PKGVER=$(awk -F= '/^pkgver=/ {print $2; exit}' aur-repo/PKGBUILD | tr -d "[:space:]")
|
||||||
@@ -315,16 +327,23 @@ jobs:
|
|||||||
PKGREL=1
|
PKGREL=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Publishing pgtidy-bin ${PKGVER}-${PKGREL} to AUR"
|
echo "Publishing ${PKG} ${PKGVER}-${PKGREL} to AUR"
|
||||||
|
|
||||||
SHA_AMD64=$(curl -fsSL "https://git.warky.dev/wdevs/pgtidy/releases/download/v${PKGVER}/pgtidy_${PKGVER}_linux_amd64.tar.gz" | sha256sum | cut -d' ' -f1)
|
DL="https://git.warky.dev/wdevs/pgtidy/releases/download/v${PKGVER}"
|
||||||
SHA_ARM64=$(curl -fsSL "https://git.warky.dev/wdevs/pgtidy/releases/download/v${PKGVER}/pgtidy_${PKGVER}_linux_arm64.tar.gz" | sha256sum | cut -d' ' -f1)
|
if [ "$PKG" = "pgtidy-bin" ]; then
|
||||||
|
SHA_AMD64=$(curl -fsSL "${DL}/pgtidy_${PKGVER}_linux_amd64.tar.gz" | sha256sum | cut -d' ' -f1)
|
||||||
|
SHA_ARM64=$(curl -fsSL "${DL}/pgtidy_${PKGVER}_linux_arm64.tar.gz" | sha256sum | cut -d' ' -f1)
|
||||||
|
SUMS=(-e "s/^sha256sums_x86_64=.*/sha256sums_x86_64=('${SHA_AMD64}')/" \
|
||||||
|
-e "s/^sha256sums_aarch64=.*/sha256sums_aarch64=('${SHA_ARM64}')/")
|
||||||
|
else
|
||||||
|
SHA_SRC=$(curl -fsSL "${DL}/pgtidy-v${PKGVER}-source.tar.gz" | sha256sum | cut -d' ' -f1)
|
||||||
|
SUMS=(-e "s/^sha256sums=.*/sha256sums=('${SHA_SRC}')/")
|
||||||
|
fi
|
||||||
|
|
||||||
sed -e "s/^pkgver=.*/pkgver=${PKGVER}/" \
|
sed -e "s/^pkgver=.*/pkgver=${PKGVER}/" \
|
||||||
-e "s/^pkgrel=.*/pkgrel=${PKGREL}/" \
|
-e "s/^pkgrel=.*/pkgrel=${PKGREL}/" \
|
||||||
-e "s/^sha256sums_x86_64=.*/sha256sums_x86_64=('${SHA_AMD64}')/" \
|
"${SUMS[@]}" \
|
||||||
-e "s/^sha256sums_aarch64=.*/sha256sums_aarch64=('${SHA_ARM64}')/" \
|
"linux/arch/${PKG}/PKGBUILD" > aur-repo/PKGBUILD
|
||||||
linux/arch/PKGBUILD > aur-repo/PKGBUILD
|
|
||||||
|
|
||||||
CID=$(docker run -d archlinux:latest sleep infinity)
|
CID=$(docker run -d archlinux:latest sleep infinity)
|
||||||
cleanup_docker() { docker rm -f "$CID" >/dev/null 2>&1 || true; }
|
cleanup_docker() { docker rm -f "$CID" >/dev/null 2>&1 || true; }
|
||||||
|
|||||||
@@ -47,9 +47,9 @@ release:
|
|||||||
NEXT="v$$MAJOR.$$MINOR.$$((PATCH + 1))"; \
|
NEXT="v$$MAJOR.$$MINOR.$$((PATCH + 1))"; \
|
||||||
PKGVER="$$MAJOR.$$MINOR.$$((PATCH + 1))"; \
|
PKGVER="$$MAJOR.$$MINOR.$$((PATCH + 1))"; \
|
||||||
echo "Current: $$CURRENT → Next: $$NEXT"; \
|
echo "Current: $$CURRENT → Next: $$NEXT"; \
|
||||||
sed -i "s/^pkgver=.*/pkgver=$$PKGVER/" linux/arch/PKGBUILD; \
|
sed -i "s/^pkgver=.*/pkgver=$$PKGVER/" linux/arch/pgtidy-bin/PKGBUILD linux/arch/pgtidy/PKGBUILD; \
|
||||||
sed -i "s/^Version:.*/Version: $$PKGVER/" linux/centos/pgtidy.spec; \
|
sed -i "s/^Version:.*/Version: $$PKGVER/" linux/centos/pgtidy.spec; \
|
||||||
git add linux/arch/PKGBUILD linux/centos/pgtidy.spec; \
|
git add linux/arch/pgtidy-bin/PKGBUILD linux/arch/pgtidy/PKGBUILD linux/centos/pgtidy.spec; \
|
||||||
git commit -m "chore(release): bump version to $$PKGVER"; \
|
git commit -m "chore(release): bump version to $$PKGVER"; \
|
||||||
git tag -a "$$NEXT" -m "Release $$NEXT"; \
|
git tag -a "$$NEXT" -m "Release $$NEXT"; \
|
||||||
git push origin HEAD "$$NEXT"; \
|
git push origin HEAD "$$NEXT"; \
|
||||||
|
|||||||
+4
-4
@@ -4,13 +4,13 @@
|
|||||||
<conf name="default" visibility="public"/>
|
<conf name="default" visibility="public"/>
|
||||||
</configurations>
|
</configurations>
|
||||||
<publications>
|
<publications>
|
||||||
<artifact name="aether-dependency-resolver" ext="jar" conf="default" url="plugins/DatabaseTools/lib"/>
|
|
||||||
<artifact name="maven-resolver-connector-basic" ext="jar" conf="default" url="plugins/DatabaseTools/lib"/>
|
|
||||||
<artifact name="database-openapi" ext="jar" conf="default" url="plugins/DatabaseTools/lib"/>
|
|
||||||
<artifact name="jdbc-console" ext="jar" conf="default" url="plugins/DatabaseTools/lib"/>
|
<artifact name="jdbc-console" ext="jar" conf="default" url="plugins/DatabaseTools/lib"/>
|
||||||
|
<artifact name="maven-resolver-transport-file" ext="jar" conf="default" url="plugins/DatabaseTools/lib"/>
|
||||||
|
<artifact name="maven-resolver-connector-basic" ext="jar" conf="default" url="plugins/DatabaseTools/lib"/>
|
||||||
<artifact name="maven-resolver-transport-http" ext="jar" conf="default" url="plugins/DatabaseTools/lib"/>
|
<artifact name="maven-resolver-transport-http" ext="jar" conf="default" url="plugins/DatabaseTools/lib"/>
|
||||||
<artifact name="database-plugin" ext="jar" conf="default" url="plugins/DatabaseTools/lib"/>
|
<artifact name="database-plugin" ext="jar" conf="default" url="plugins/DatabaseTools/lib"/>
|
||||||
<artifact name="maven-resolver-transport-file" ext="jar" conf="default" url="plugins/DatabaseTools/lib"/>
|
<artifact name="database-openapi" ext="jar" conf="default" url="plugins/DatabaseTools/lib"/>
|
||||||
|
<artifact name="aether-dependency-resolver" ext="jar" conf="default" url="plugins/DatabaseTools/lib"/>
|
||||||
</publications>
|
</publications>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency org="bundledPlugin" name="intellij.grid.core.impl" rev="DB-243.21565.204"/>
|
<dependency org="bundledPlugin" name="intellij.grid.core.impl" rev="DB-243.21565.204"/>
|
||||||
|
|||||||
+1
-1
@@ -4,8 +4,8 @@
|
|||||||
<conf name="default" visibility="public"/>
|
<conf name="default" visibility="public"/>
|
||||||
</configurations>
|
</configurations>
|
||||||
<publications>
|
<publications>
|
||||||
<artifact name="json-split" ext="jar" conf="default" url="plugins/json/lib"/>
|
|
||||||
<artifact name="json" ext="jar" conf="default" url="plugins/json/lib"/>
|
<artifact name="json" ext="jar" conf="default" url="plugins/json/lib"/>
|
||||||
|
<artifact name="json-split" ext="jar" conf="default" url="plugins/json/lib"/>
|
||||||
</publications>
|
</publications>
|
||||||
<dependencies/>
|
<dependencies/>
|
||||||
</ivy-module>
|
</ivy-module>
|
||||||
+1
-1
@@ -4,8 +4,8 @@
|
|||||||
<conf name="default" visibility="public"/>
|
<conf name="default" visibility="public"/>
|
||||||
</configurations>
|
</configurations>
|
||||||
<publications>
|
<publications>
|
||||||
<artifact name="grid-core-impl" ext="jar" conf="default" url="plugins/grid-core-impl/lib"/>
|
|
||||||
<artifact name="jdbc-console-types" ext="jar" conf="default" url="plugins/grid-core-impl/lib"/>
|
<artifact name="jdbc-console-types" ext="jar" conf="default" url="plugins/grid-core-impl/lib"/>
|
||||||
|
<artifact name="grid-core-impl" ext="jar" conf="default" url="plugins/grid-core-impl/lib"/>
|
||||||
</publications>
|
</publications>
|
||||||
<dependencies/>
|
<dependencies/>
|
||||||
</ivy-module>
|
</ivy-module>
|
||||||
@@ -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.9
|
pkgver=0.0.10
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="PostgreSQL SQL formatter and linter"
|
pkgdesc="PostgreSQL SQL formatter and linter"
|
||||||
arch=('x86_64' 'aarch64')
|
arch=('x86_64' 'aarch64')
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
# Maintainer: Hein (Warky Devs) <hein@warky.dev>
|
||||||
|
pkgname=pgtidy
|
||||||
|
pkgver=0.0.10
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc="PostgreSQL SQL formatter and linter"
|
||||||
|
arch=('x86_64' 'aarch64')
|
||||||
|
url="https://git.warky.dev/wdevs/pgtidy"
|
||||||
|
license=('MIT')
|
||||||
|
makedepends=('go')
|
||||||
|
conflicts=('pgtidy-bin')
|
||||||
|
source=("$pkgname-$pkgver.tar.gz::$url/releases/download/v$pkgver/pgtidy-v$pkgver-source.tar.gz")
|
||||||
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd "$pkgname-$pkgver"
|
||||||
|
export CGO_ENABLED=0
|
||||||
|
go build \
|
||||||
|
-trimpath \
|
||||||
|
-ldflags "-X main.version=v$pkgver" \
|
||||||
|
-o "$pkgname" ./cmd/pgtidy
|
||||||
|
}
|
||||||
|
|
||||||
|
check() {
|
||||||
|
cd "$pkgname-$pkgver"
|
||||||
|
go test ./...
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
cd "$pkgname-$pkgver"
|
||||||
|
install -Dm755 "$pkgname" "$pkgdir/usr/bin/$pkgname"
|
||||||
|
install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
Name: pgtidy
|
Name: pgtidy
|
||||||
Version: 0.0.9
|
Version: 0.0.10
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: PostgreSQL SQL formatter and linter
|
Summary: PostgreSQL SQL formatter and linter
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user