From c0fb95eac76ced1488c514821fba05b3aa21ba96 Mon Sep 17 00:00:00 2001 From: everpcpc Date: Tue, 10 Oct 2023 10:14:54 +0800 Subject: [PATCH] chore(ci): check with cargo deny (#254) * chore: bump version to 0.8.1 --- .github/actions/check/action.yml | 14 ++++++-- .github/workflows/publish.yml | 28 ---------------- .github/workflows/release.yml | 21 ++++++++++++ Cargo.toml | 10 +++--- 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 +- cli/Cargo.toml | 4 +-- deny.toml | 32 +++++++++++++++++++ sql/Cargo.toml | 4 +-- 12 files changed, 78 insertions(+), 45 deletions(-) delete mode 100644 .github/workflows/publish.yml create mode 100644 deny.toml diff --git a/.github/actions/check/action.yml b/.github/actions/check/action.yml index 0dd0fc536..b46574bff 100644 --- a/.github/actions/check/action.yml +++ b/.github/actions/check/action.yml @@ -19,16 +19,24 @@ runs: run: | cargo fmt --all -- --check + - name: Install Check Tools + env: + GH_TOKEN: ${{ github.token }} + shell: bash + run: | + cargo install cargo-quickinstall + cargo quickinstall cargo-machete + cargo quickinstall cargo-deny + - name: Machete shell: bash run: | - cargo install cargo-machete --force cargo machete - - name: Audit dependencies + - name: Deny Check shell: bash run: | - cargo audit + cargo deny check - name: Clippy shell: bash diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index cd27b84a2..000000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Publish - -on: - push: - branches: - - main - paths: - - "Cargo.toml" - -jobs: - crates: - runs-on: ubuntu-latest - environment: - name: crates.io - url: https://crates.io/crates/databend-driver - steps: - - uses: actions/checkout@v4 - - 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 3cbd64533..e7cbf1022 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,27 @@ on: - 'v*' jobs: + publish: + runs-on: ubuntu-latest + environment: + name: crates.io + url: https://crates.io/crates/databend-driver + steps: + - uses: actions/checkout@v4 + - name: Setup Cargo Release + run: | + curl -fsSLo /tmp/cargo-release.tar.gz https://github.com/crate-ci/cargo-release/releases/download/v0.24.12/cargo-release-v0.24.12-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 + build_linux: + needs: publish name: build ${{ matrix.target }} strategy: matrix: @@ -42,6 +62,7 @@ jobs: gh release upload ${{ github.ref_name }} dist/bendsql-${{ matrix.target }}.tar.gz --clobber build_other: + needs: publish name: build ${{ matrix.target }} strategy: matrix: diff --git a/Cargo.toml b/Cargo.toml index 246626c19..4c67b6e00 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ members = [ resolver = "2" [workspace.package] -version = "0.8.0" +version = "0.8.1" edition = "2021" license = "Apache-2.0" authors = ["Databend Authors "] @@ -21,7 +21,7 @@ keywords = ["databend", "database"] repository = "https://github.com/datafuselabs/bendsql" [workspace.dependencies] -databend-client = { path = "core", version = "0.8.0" } -databend-driver = { path = "driver", version = "0.8.0" } -databend-driver-macros = { path = "macros", version = "0.8.0" } -databend-sql = { path = "sql", version = "0.8.0" } +databend-client = { path = "core", version = "0.8.1" } +databend-driver = { path = "driver", version = "0.8.1" } +databend-driver-macros = { path = "macros", version = "0.8.1" } +databend-sql = { path = "sql", version = "0.8.1" } diff --git a/bindings/nodejs/npm/darwin-arm64/package.json b/bindings/nodejs/npm/darwin-arm64/package.json index 9674e9eea..e76b673ca 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.8.0", + "version": "0.8.1", "os": [ "darwin" ], diff --git a/bindings/nodejs/npm/darwin-x64/package.json b/bindings/nodejs/npm/darwin-x64/package.json index 62a6774a9..a48cb2e83 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.8.0", + "version": "0.8.1", "os": [ "darwin" ], diff --git a/bindings/nodejs/npm/linux-x64-gnu/package.json b/bindings/nodejs/npm/linux-x64-gnu/package.json index d20961066..c7decbf82 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.8.0", + "version": "0.8.1", "os": [ "linux" ], diff --git a/bindings/nodejs/npm/win32-x64-msvc/package.json b/bindings/nodejs/npm/win32-x64-msvc/package.json index 826aa3e94..0608eba4a 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.8.0", + "version": "0.8.1", "os": [ "win32" ], diff --git a/bindings/nodejs/package.json b/bindings/nodejs/package.json index 3563285e5..de4fe8715 100644 --- a/bindings/nodejs/package.json +++ b/bindings/nodejs/package.json @@ -1,7 +1,7 @@ { "name": "databend-driver", "author": "Databend Authors ", - "version": "0.8.0", + "version": "0.8.1", "license": "Apache-2.0", "main": "index.js", "types": "index.d.ts", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 4af9bc908..28f40c017 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -27,7 +27,7 @@ serde = { version = "1.0", features = ["derive"] } sqlformat = "0.2" strum = "0.25" strum_macros = "0.25" -terminal_size = "0.2" +terminal_size = "0.3" tokio = { version = "1.28", features = [ "macros", "rt", @@ -36,7 +36,7 @@ tokio = { version = "1.28", features = [ "parking_lot", ] } tokio-stream = "0.1" -toml = "0.7" +toml = "0.8" unicode-segmentation = "1.10" url = { version = "2.4", default-features = false } diff --git a/deny.toml b/deny.toml new file mode 100644 index 000000000..64cb8972a --- /dev/null +++ b/deny.toml @@ -0,0 +1,32 @@ +[advisories] +db-path = "~/.cargo/advisory-db" +db-urls = ["https://github.com/rustsec/advisory-db"] +vulnerability = "deny" +unmaintained = "warn" +yanked = "warn" +notice = "warn" +ignore = [ + #"RUSTSEC-0000-0000", +] + +[licenses] +unlicensed = "warn" +allow = [ + "MIT", + "CC0-1.0", + "BSD-3-Clause", + "Unicode-DFS-2016", + "ISC", + "MPL-2.0", + "BSL-1.0", + "Apache-2.0", + "Apache-2.0 WITH LLVM-exception", +] + +[bans] +multiple-versions = "allow" +wildcards = "warn" +highlight = "all" + +[sources] +unknown-git = "deny" diff --git a/sql/Cargo.toml b/sql/Cargo.toml index 66336ffeb..aabee022b 100644 --- a/sql/Cargo.toml +++ b/sql/Cargo.toml @@ -18,8 +18,8 @@ databend-client = { workspace = true } chrono = { version = "0.4", default-features = false } glob = "0.3" -itertools = "0.10" -jsonb = { git = "https://github.com/datafuselabs/jsonb", rev = "3a3c6ef" } +itertools = "0.11" +jsonb = "0.2" roaring = { version = "0.10.1", features = ["serde"] } serde = { version = "1.0", default-features = false, features = ["derive"] } serde_json = { version = "1.0", default-features = false, features = ["std"] }