Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
os: ubuntu-latest
- target: aarch64-apple-darwin
os: macos-14
- target: x86_64-apple-darwin
os: macos-15-intel
- target: x86_64-pc-windows-msvc
os: windows-latest

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clickhouse-query-ext"
version = "1.0.2"
version = "1.0.3"
edition = "2024"
authors = ["Querya Community"]
description = "High-performance ClickHouse driver for Querya Desktop"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ cargo build --release
| Файл | Назначение |
|------|------------|
| `target/release/clickhouse-query-ext` | Бинарник драйвера |
| `dist/clickhouse-query-ext-1.0.2.qext` | Пакет для установки в Querya Desktop |
| `dist/clickhouse-query-ext-1.0.2.qext.sha256` | Контрольная сумма |
| `dist/clickhouse-query-ext-1.0.3.qext` | Пакет для установки в Querya Desktop |
| `dist/clickhouse-query-ext-1.0.3.qext.sha256` | Контрольная сумма |

Установка: **Querya Desktop → Extensions → Install from file** → выбрать `.qext`.

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "queryahub.clickhouse-driver",
"name": "ClickHouse Database Driver (Analyst Edition)",
"version": "1.0.2",
"version": "1.0.3",
"publisher": "Querya Community",
"description": "Изолированный нативный Rust-драйвер для аналитической СУБД ClickHouse с полной поддержкой MergeTree, словарей, партиций и SDUI-интроспекции.",
"type": "database_driver",
Expand Down
31 changes: 24 additions & 7 deletions scripts/package_qext.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#!/usr/bin/env bash
set -eo pipefail

# Windows runners ship `python`, not `python3`; a missing interpreter used to
# fall back silently to version 1.0.0 and name the archive after it.
if command -v python3 >/dev/null 2>&1; then
PY=python3
elif command -v python >/dev/null 2>&1; then
PY=python
else
echo "❌ Error: python3 (or python) is required to package the extension."
exit 1
fi

# Script to package clickhouse-query-ext binary along with manifest.json and assets/
# into a distribution .qext archive (.zip) and generate SHA-256 checksums for Querya Desktop Block B validation.

Expand Down Expand Up @@ -47,7 +58,11 @@ else
fi

# Extract version from manifest.json using Python (works reliably across platforms)
VERSION=$(python3 -c "import json; print(json.load(open('manifest.json'))['version'])" 2>/dev/null || echo "1.0.0")
VERSION=$("$PY" -c "import json; print(json.load(open('manifest.json'))['version'])")
if [ -z "$VERSION" ]; then
echo "❌ Error: could not read the version from manifest.json."
exit 1
fi

echo "=========================================================================="
echo "📦 Packaging Querya Extension (.qext) for target: ${TARGET}"
Expand All @@ -66,7 +81,7 @@ cp -r assets/* "${STAGING_DIR}/assets/"

# For Windows targets, adjust manifest.json main entry point to include .exe extension
if [[ "$TARGET" == *"windows"* ]] || [[ "$DEST_BIN_NAME" == *".exe" ]]; then
python3 -c "
"$PY" -c "
import json, sys
manifest_path = sys.argv[1]
dest_bin = sys.argv[2]
Expand Down Expand Up @@ -97,7 +112,7 @@ ARCHIVE_NAME="clickhouse-query-ext-${VERSION}-${TARGET}.qext"
ARCHIVE_PATH="dist/${ARCHIVE_NAME}"
rm -f "${ARCHIVE_PATH}"

python3 -c "
"$PY" -c "
import zipfile, os, sys
archive_path = sys.argv[1]
staging_dir = sys.argv[2]
Expand All @@ -109,17 +124,19 @@ with zipfile.ZipFile(archive_path, 'w', zipfile.ZIP_DEFLATED) as zipf:
zipf.write(full_path, rel_path)
" "${ARCHIVE_PATH}" "${STAGING_DIR}"

# Also create universal/shorthand name if packaging host target
# Also create the shorthand name for the Linux build only: every runner of the
# release matrix would otherwise upload a file of that name, and the last one
# downloaded would win.
HOST_TARGET=$(rustc -vV | sed -n 's|host: ||p' 2>/dev/null || echo "")
if [ "$TARGET" = "$HOST_TARGET" ]; then
if [ "$TARGET" = "$HOST_TARGET" ] && [[ "$TARGET" == *linux* ]]; then
cp "${ARCHIVE_PATH}" "dist/clickhouse-query-ext-${VERSION}.qext"
fi

# 4. Generate SHA-256 checksums
generate_sha256() {
local file_path="$1"
local sha_output="${file_path}.sha256"
python3 -c "
"$PY" -c "
import hashlib, sys, os
with open(sys.argv[1], 'rb') as f:
print(hashlib.sha256(f.read()).hexdigest() + ' *' + os.path.basename(sys.argv[1]))
Expand All @@ -128,7 +145,7 @@ with open(sys.argv[1], 'rb') as f:
}

generate_sha256 "${ARCHIVE_PATH}"
if [ -f "dist/clickhouse-query-ext-${VERSION}.qext" ] && [ "$TARGET" = "$HOST_TARGET" ]; then
if [ -f "dist/clickhouse-query-ext-${VERSION}.qext" ] && [ "$TARGET" = "$HOST_TARGET" ] && [[ "$TARGET" == *linux* ]]; then
generate_sha256 "dist/clickhouse-query-ext-${VERSION}.qext"
fi

Expand Down
Loading