From 0051173e9a699ad4d148bf78f999b400aaa01876 Mon Sep 17 00:00:00 2001 From: everpcpc Date: Tue, 11 Jul 2023 16:16:56 +0800 Subject: [PATCH] chore: unify version for packages (#148) --- .github/workflows/bindings.nodejs.yml | 7 +++++- .github/workflows/publish.yml | 25 ------------------- .github/workflows/release.yml | 17 +++++++++++++ Cargo.toml | 14 +++++++++++ bindings/nodejs/Cargo.toml | 11 +++++--- bindings/nodejs/npm/darwin-arm64/package.json | 2 +- bindings/nodejs/npm/darwin-x64/package.json | 2 +- .../nodejs/npm/linux-x64-gnu/package.json | 2 +- .../nodejs/npm/win32-x64-msvc/package.json | 2 +- bindings/nodejs/package.json | 2 +- bindings/python/Cargo.toml | 14 +++++++---- cli/Cargo.toml | 13 ++++++---- core/Cargo.toml | 10 +++++--- driver/Cargo.toml | 13 ++++++---- 14 files changed, 80 insertions(+), 54 deletions(-) delete mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/bindings.nodejs.yml b/.github/workflows/bindings.nodejs.yml index 2a64c969..25c8bbb1 100644 --- a/.github/workflows/bindings.nodejs.yml +++ b/.github/workflows/bindings.nodejs.yml @@ -4,6 +4,8 @@ on: push: branches: - main + tags: + - v* pull_request: branches: - main @@ -99,9 +101,12 @@ jobs: path: bindings/nodejs/*.node publish: - if: github.event_name == 'push' + if: startsWith(github.ref, 'refs/tags/v') needs: build runs-on: ubuntu-latest + permissions: + contents: read + id-token: write steps: - uses: actions/checkout@v3 - name: Setup node diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 064ba673..00000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: publish - -on: - push: - branches: - - main - paths: - - '**/Cargo.toml' - -jobs: - crates: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup Cargo Release - run: | - curl -fsSLo /tmp/cargo-release.tar.gz https://github.com/crate-ci/cargo-release/releases/download/v0.24.8/cargo-release-v0.24.8-x86_64-unknown-linux-gnu.tar.gz - mkdir -p /tmp/cargo-release - tar -C /tmp/cargo-release -xzf /tmp/cargo-release.tar.gz - sudo mv /tmp/cargo-release/cargo-release /usr/local/bin - - name: Release to crates.io - env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - run: | - cargo release publish --execute --no-confirm diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5b471fda..cc784f9d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -80,6 +80,23 @@ jobs: 7z a -tzip dist/bendsql-${{ matrix.target }}.zip target/${{ matrix.target }}/release/bendsql.exe gh release upload ${{ github.ref_name }} dist/bendsql-${{ matrix.target }}.zip --clobber + crates: + needs: build_linux + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup Cargo Release + run: | + curl -fsSLo /tmp/cargo-release.tar.gz https://github.com/crate-ci/cargo-release/releases/download/v0.24.8/cargo-release-v0.24.8-x86_64-unknown-linux-gnu.tar.gz + mkdir -p /tmp/cargo-release + tar -C /tmp/cargo-release -xzf /tmp/cargo-release.tar.gz + sudo mv /tmp/cargo-release/cargo-release /usr/local/bin + - name: Release to crates.io + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + run: | + cargo release publish --execute --no-confirm + distribution: needs: build_linux runs-on: ubuntu-latest diff --git a/Cargo.toml b/Cargo.toml index d83b6e35..3f5ee9ca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +default-members = ["core", "driver", "cli"] members = [ "core", "driver", @@ -6,3 +7,16 @@ members = [ "bindings/python", "bindings/nodejs", ] + +[workspace.package] +version = "0.4.1" +edition = "2021" +license = "Apache-2.0" +authors = ["Databend Authors "] +categories = ["database"] +keywords = ["databend", "database"] +repository = "https://github.com/datafuselabs/bendsql" + +[workspace.dependencies] +databend-client = { path = "core", version = "0.4.1" } +databend-driver = { path = "driver", version = "0.4.1" } diff --git a/bindings/nodejs/Cargo.toml b/bindings/nodejs/Cargo.toml index 73ef97f2..a2d964de 100644 --- a/bindings/nodejs/Cargo.toml +++ b/bindings/nodejs/Cargo.toml @@ -1,16 +1,19 @@ [package] name = "bindings-nodejs" -version = "0.1.0" -edition = "2021" -license = "Apache-2.0" publish = false +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +authors = { workspace = true } +repository = { workspace = true } + [lib] crate-type = ["cdylib"] doc = false [dependencies] -databend-driver = { path = "../../driver", version = "0.3.1", features = ["rustls", "flight-sql"] } +databend-driver = { workspace = true, features = ["rustls", "flight-sql"] } futures = "0.3.28" napi = { version = "2.13.2", default-features = false, features = [ "napi6", diff --git a/bindings/nodejs/npm/darwin-arm64/package.json b/bindings/nodejs/npm/darwin-arm64/package.json index 62e41730..745f3f49 100644 --- a/bindings/nodejs/npm/darwin-arm64/package.json +++ b/bindings/nodejs/npm/darwin-arm64/package.json @@ -1,7 +1,7 @@ { "name": "@databend-driver/lib-darwin-arm64", "repository": "https://github.com/datafuselabs/bendsql.git", - "version": "0.1.0", + "version": "0.4.1", "os": [ "darwin" ], diff --git a/bindings/nodejs/npm/darwin-x64/package.json b/bindings/nodejs/npm/darwin-x64/package.json index 86f256b1..a5281543 100644 --- a/bindings/nodejs/npm/darwin-x64/package.json +++ b/bindings/nodejs/npm/darwin-x64/package.json @@ -1,7 +1,7 @@ { "name": "@databend-driver/lib-darwin-x64", "repository": "https://github.com/datafuselabs/bendsql.git", - "version": "0.1.0", + "version": "0.4.1", "os": [ "darwin" ], diff --git a/bindings/nodejs/npm/linux-x64-gnu/package.json b/bindings/nodejs/npm/linux-x64-gnu/package.json index 52396252..6c1a8571 100644 --- a/bindings/nodejs/npm/linux-x64-gnu/package.json +++ b/bindings/nodejs/npm/linux-x64-gnu/package.json @@ -1,7 +1,7 @@ { "name": "@databend-driver/lib-linux-x64-gnu", "repository": "https://github.com/datafuselabs/bendsql.git", - "version": "0.1.0", + "version": "0.4.1", "os": [ "linux" ], diff --git a/bindings/nodejs/npm/win32-x64-msvc/package.json b/bindings/nodejs/npm/win32-x64-msvc/package.json index e2795780..3b5e64b3 100644 --- a/bindings/nodejs/npm/win32-x64-msvc/package.json +++ b/bindings/nodejs/npm/win32-x64-msvc/package.json @@ -1,7 +1,7 @@ { "name": "@databend-driver/lib-win32-x64-msvc", "repository": "https://github.com/datafuselabs/bendsql.git", - "version": "0.1.0", + "version": "0.4.1", "os": [ "win32" ], diff --git a/bindings/nodejs/package.json b/bindings/nodejs/package.json index 6deeeef9..b992a2b8 100644 --- a/bindings/nodejs/package.json +++ b/bindings/nodejs/package.json @@ -1,7 +1,7 @@ { "name": "databend-driver", "author": "Databend Authors ", - "version": "0.1.0", + "version": "0.4.1", "license": "Apache-2.0", "main": "index.js", "types": "index.d.ts", diff --git a/bindings/python/Cargo.toml b/bindings/python/Cargo.toml index 20577e0c..23698689 100644 --- a/bindings/python/Cargo.toml +++ b/bindings/python/Cargo.toml @@ -17,19 +17,23 @@ [package] name = "databend-python" -version = "0.0.1" -edition = "2021" -license = "Apache-2.0" publish = false +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +authors = { workspace = true } +repository = { workspace = true } + [lib] crate-type = ["cdylib"] doc = false [dependencies] +databend-client = { workspace = true } +databend-driver = { workspace = true, features = ["rustls", "flight-sql"] } + chrono = { version = "0.4.24", default-features = false, features = ["std"] } -databend-client = { version = "0.2.0", path = "../../core" } -databend-driver = { path = "../../driver", version = "0.3.0", features = ["rustls", "flight-sql"] } futures = "0.3.28" pyo3 = { version = "0.18", features = ["abi3-py37"] } pyo3-asyncio = { version = "0.18", features = ["tokio-runtime"] } diff --git a/cli/Cargo.toml b/cli/Cargo.toml index c6960031..24f9eca3 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,21 +1,24 @@ [package] name = "bendsql" -version = "0.4.1" -edition = "2021" -license = "Apache-2.0" description = "Databend Native Command Line Tool" categories = ["database"] keywords = ["databend", "database", "cli"] -repository = "https://github.com/datafuselabs/databend-client" + +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +authors = { workspace = true } +repository = { workspace = true } [dependencies] +databend-driver = { workspace = true, features = ["rustls", "flight-sql"] } + anyhow = "1.0.70" async-trait = "0.1.68" chrono = { version = "0.4.24", default-features = false, features = ["clock"] } clap = { version = "4.1.0", features = ["derive", "env"] } comfy-table = "6.1.4" csv = "1.2.1" -databend-driver = { path = "../driver", version = "0.3.1", features = ["rustls", "flight-sql"] } futures = { version = "0.3", default-features = false, features = ["alloc"] } humantime-serde = "1.1.1" indicatif = "0.17.3" diff --git a/core/Cargo.toml b/core/Cargo.toml index ca9f3bb0..89b2ce05 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -1,12 +1,14 @@ [package] name = "databend-client" -version = "0.2.1" -edition = "2021" -license = "Apache-2.0" description = "Databend Client for Rust" categories = ["database"] keywords = ["databend", "database", "sdk"] -repository = "https://github.com/datafuselabs/databend-client" + +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +authors = { workspace = true } +repository = { workspace = true } [features] default = ["rustls"] diff --git a/driver/Cargo.toml b/driver/Cargo.toml index 4aa669a8..6b68bf78 100644 --- a/driver/Cargo.toml +++ b/driver/Cargo.toml @@ -1,12 +1,14 @@ [package] name = "databend-driver" -version = "0.3.1" -edition = "2021" -license = "Apache-2.0" description = "Databend Driver for Rust" categories = ["database"] keywords = ["databend", "database", "sdk"] -repository = "https://github.com/datafuselabs/databend-client" + +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +authors = { workspace = true } +repository = { workspace = true } [features] default = ["rustls"] @@ -19,9 +21,10 @@ native-tls = ["databend-client/native-tls"] flight-sql = ["dep:arrow-array", "dep:arrow-cast", "dep:arrow-flight", "dep:arrow-schema", "dep:tonic"] [dependencies] +databend-client = { workspace = true } + async-trait = "0.1.68" chrono = { version = "0.4.24", default-features = false, features = ["clock"] } -databend-client = { version = "0.2.1", path = "../core" } dyn-clone = "1.0.11" http = "0.2.9" percent-encoding = "2.2.0"