From a881905cf84e5d10b31dbcbb11175ec295d2710f Mon Sep 17 00:00:00 2001 From: everpcpc Date: Wed, 17 Jul 2024 13:11:35 +0800 Subject: [PATCH] chore(ci): add dry run for cargo publish (#455) --- .github/workflows/publish.yml | 40 ++++++++++++++++++++++------------- Cargo.toml | 4 ++-- driver/Cargo.toml | 4 ++-- driver/src/conn.rs | 8 +++---- driver/src/flight_sql.rs | 8 ++++--- driver/src/lib.rs | 12 ++++++----- driver/src/rest_api.rs | 6 +++--- sql/Cargo.toml | 4 ++-- 8 files changed, 50 insertions(+), 36 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7acfa9f1..aa134902 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,7 +5,12 @@ on: branches: - main paths: - - "Cargo.toml" + - "Cargo.toml" + pull_request: + branches: + - main + paths: + - "Cargo.toml" jobs: crates: @@ -14,17 +19,22 @@ jobs: name: crates.io url: https://crates.io/crates/databend-driver steps: - - uses: actions/checkout@v4 - - name: Setup Rust toolchain - uses: ./.github/actions/setup - with: - cache-key: publish - - name: Setup Cargo Release - run: | - cargo install cargo-quickinstall - cargo quickinstall cargo-release - - name: Release to crates.io - env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - run: | - cargo release publish --execute --no-confirm + - uses: actions/checkout@v4 + - name: Setup Rust toolchain + uses: ./.github/actions/setup + with: + cache-key: publish + - name: Setup Cargo workspaces + run: | + cargo install cargo-quickinstall + cargo quickinstall cargo-workspaces + - name: Dry run release + if: github.event_name == 'pull_request' + run: | + cargo workspaces publish --all --dry-run --publish-as-is + - name: Release to crates.io + if: github.event_name == 'push' + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + run: | + cargo workspaces publish --all --publish-as-is --yes diff --git a/Cargo.toml b/Cargo.toml index 7e7624c8..6fea08c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,8 +12,8 @@ members = [ resolver = "2" [workspace.package] -version = "0.19.0" edition = "2021" +version = "0.19.0" license = "Apache-2.0" authors = ["Databend Authors "] categories = ["database"] @@ -23,8 +23,8 @@ repository = "https://github.com/datafuselabs/bendsql" [workspace.dependencies] databend-client = { path = "core", version = "0.19.0" } databend-driver = { path = "driver", version = "0.19.0" } +databend-driver-core = { path = "sql", version = "0.19.0" } databend-driver-macros = { path = "macros", version = "0.19.0" } -databend-sql = { path = "sql", version = "0.19.0" } [patch.crates-io] pyo3-asyncio = { git = "https://github.com/everpcpc/pyo3-asyncio", rev = "42af887" } diff --git a/driver/Cargo.toml b/driver/Cargo.toml index f82a38d2..cd8d66f3 100644 --- a/driver/Cargo.toml +++ b/driver/Cargo.toml @@ -22,13 +22,13 @@ flight-sql = [ "dep:arrow-flight", "dep:arrow-schema", "dep:tonic", - "databend-sql/flight-sql", + "databend-driver-core/flight-sql", ] [dependencies] databend-client = { workspace = true } +databend-driver-core = { workspace = true } databend-driver-macros = { workspace = true } -databend-sql = { workspace = true } async-compression = { version = "0.4", features = ["tokio", "zstd"] } async-trait = "0.1" diff --git a/driver/src/conn.rs b/driver/src/conn.rs index 7708f881..4292492a 100644 --- a/driver/src/conn.rs +++ b/driver/src/conn.rs @@ -28,10 +28,10 @@ use crate::flight_sql::FlightSQLConnection; use databend_client::presign::{presign_download_from_stage, PresignedResponse}; use databend_client::stage::StageLocation; -use databend_sql::error::{Error, Result}; -use databend_sql::rows::{Row, RowIterator, RowStatsIterator, RowWithStats, ServerStats}; -use databend_sql::schema::{DataType, Field, NumberDataType, Schema}; -use databend_sql::value::{NumberValue, Value}; +use databend_driver_core::error::{Error, Result}; +use databend_driver_core::rows::{Row, RowIterator, RowStatsIterator, RowWithStats, ServerStats}; +use databend_driver_core::schema::{DataType, Field, NumberDataType, Schema}; +use databend_driver_core::value::{NumberValue, Value}; use crate::rest_api::RestAPIConnection; diff --git a/driver/src/flight_sql.rs b/driver/src/flight_sql.rs index 8c38fcfd..dfaaf5b2 100644 --- a/driver/src/flight_sql.rs +++ b/driver/src/flight_sql.rs @@ -33,9 +33,11 @@ use url::Url; use databend_client::auth::SensitiveString; use databend_client::presign::{presign_upload_to_stage, PresignedResponse}; -use databend_sql::error::{Error, Result}; -use databend_sql::rows::{Row, RowIterator, RowStatsIterator, RowWithStats, Rows, ServerStats}; -use databend_sql::schema::Schema; +use databend_driver_core::error::{Error, Result}; +use databend_driver_core::rows::{ + Row, RowIterator, RowStatsIterator, RowWithStats, Rows, ServerStats, +}; +use databend_driver_core::schema::Schema; use crate::conn::{Connection, ConnectionInfo, Reader}; diff --git a/driver/src/lib.rs b/driver/src/lib.rs index 6b62a1df..9805a08b 100644 --- a/driver/src/lib.rs +++ b/driver/src/lib.rs @@ -20,14 +20,16 @@ mod rest_api; pub use conn::{Client, Connection, ConnectionInfo}; // pub use for convenience -pub use databend_sql::error::{Error, Result}; -pub use databend_sql::rows::{Row, RowIterator, RowStatsIterator, RowWithStats, ServerStats}; -pub use databend_sql::schema::{DataType, DecimalSize, Field, Schema, SchemaRef}; -pub use databend_sql::value::{NumberValue, Value}; +pub use databend_driver_core::error::{Error, Result}; +pub use databend_driver_core::rows::{ + Row, RowIterator, RowStatsIterator, RowWithStats, ServerStats, +}; +pub use databend_driver_core::schema::{DataType, DecimalSize, Field, Schema, SchemaRef}; +pub use databend_driver_core::value::{NumberValue, Value}; pub use databend_driver_macros::TryFromRow; #[doc(hidden)] pub mod _macro_internal { - pub use databend_sql::_macro_internal::*; + pub use databend_driver_core::_macro_internal::*; } diff --git a/driver/src/rest_api.rs b/driver/src/rest_api.rs index ae50da34..4aa63a79 100644 --- a/driver/src/rest_api.rs +++ b/driver/src/rest_api.rs @@ -31,9 +31,9 @@ use databend_client::error::Error as ClientError; use databend_client::presign::PresignedResponse; use databend_client::response::QueryResponse; use databend_client::APIClient; -use databend_sql::error::{Error, Result}; -use databend_sql::rows::{Row, RowIterator, RowStatsIterator, RowWithStats, ServerStats}; -use databend_sql::schema::{Schema, SchemaRef}; +use databend_driver_core::error::{Error, Result}; +use databend_driver_core::rows::{Row, RowIterator, RowStatsIterator, RowWithStats, ServerStats}; +use databend_driver_core::schema::{Schema, SchemaRef}; use crate::conn::{Connection, ConnectionInfo, Reader}; diff --git a/sql/Cargo.toml b/sql/Cargo.toml index 3096fe28..20b0495c 100644 --- a/sql/Cargo.toml +++ b/sql/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "databend-sql" -description = "SQL types for Databend Driver" +name = "databend-driver-core" +description = "Core components for Databend Driver" categories = ["database"] keywords = ["databend", "database", "sdk"]