diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cd0ba71..68aeed7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/Cargo.lock b/Cargo.lock index 0f78a5c..839553c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -82,7 +82,7 @@ dependencies = [ [[package]] name = "clickhouse-query-ext" -version = "1.0.2" +version = "1.0.3" dependencies = [ "anyhow", "bytes", diff --git a/Cargo.toml b/Cargo.toml index 03b2c86..1b2abf6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/README.md b/README.md index 4323322..c7dce7d 100644 --- a/README.md +++ b/README.md @@ -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`. diff --git a/manifest.json b/manifest.json index e6d0662..b1cb365 100644 --- a/manifest.json +++ b/manifest.json @@ -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", diff --git a/scripts/package_qext.sh b/scripts/package_qext.sh index 253bab2..2f4db44 100755 --- a/scripts/package_qext.sh +++ b/scripts/package_qext.sh @@ -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. @@ -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}" @@ -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] @@ -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] @@ -109,9 +124,11 @@ 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 @@ -119,7 +136,7 @@ fi 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])) @@ -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