Skip to content

Commit

Permalink
chore(ci): add dry run for cargo publish (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
everpcpc authored Jul 17, 2024
1 parent 25c6594 commit a881905
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 36 deletions.
40 changes: 25 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ on:
branches:
- main
paths:
- "Cargo.toml"
- "Cargo.toml"
pull_request:
branches:
- main
paths:
- "Cargo.toml"

jobs:
crates:
Expand All @@ -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
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>"]
categories = ["database"]
Expand All @@ -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" }
4 changes: 2 additions & 2 deletions driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions driver/src/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
8 changes: 5 additions & 3 deletions driver/src/flight_sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
12 changes: 7 additions & 5 deletions driver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
}
6 changes: 3 additions & 3 deletions driver/src/rest_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
4 changes: 2 additions & 2 deletions sql/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"]

Expand Down

0 comments on commit a881905

Please sign in to comment.