Skip to content

Commit 608ac10

Browse files
authored
enable publish crates in CI (#21)
enable publish crates in CI
1 parent 2826401 commit 608ac10

File tree

3 files changed

+48
-7
lines changed

3 files changed

+48
-7
lines changed

.github/workflows/rust.yaml

+45-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ name: CI
22

33
on:
44
push:
5-
branches:
6-
- main
5+
branches: [ main ]
6+
tags: [ '*' ]
77
pull_request:
8-
branches:
9-
- main
8+
branches: [ main ]
109
env:
1110
RUST_BACKTRACE: 1
1211
jobs:
@@ -35,17 +34,59 @@ jobs:
3534
rust-version: stable${{ matrix.host }}
3635
targets: ${{ matrix.target }}
3736
components: 'rustfmt, clippy'
37+
3838
- run: cargo fmt --all -- --check
39+
# - name: Download DuckDB
40+
# run: |
41+
# wget https://github.com/duckdb/duckdb/releases/download/v0.2.8/libduckdb-linux-amd64.zip -O libduckdb.zip
42+
# unzip libduckdb.zip -d libduckdb
43+
# - run: cargo clippy --all-targets --workspace --features buildtime_bindgen --features modern-full -- -D warnings -A clippy::redundant-closure
3944
- run: cargo clippy --all-targets --workspace --features bundled --features modern-full -- -D warnings -A clippy::redundant-closure
45+
name: run cargo clippy
46+
# env:
47+
# DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb
48+
# DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb
49+
# LD_LIBRARY_PATH: ${{ github.workspace }}/libduckdb
4050
- name: Run cargo-tarpaulin
4151
uses: actions-rs/[email protected]
4252
with:
4353
# Intentionally omit time feature until we're on time 0.3, at which
4454
# point it should be added to `bundled-full`.
55+
# args: '--features "buildtime_bindgen" --features "modern-full" --avoid-cfg-tarpaulin' # TODO restore to normal (https://github.com/xd009642/tarpaulin/issues/756#issuecomment-838769320)
4556
args: '--features "bundled" --features "modern-full" --avoid-cfg-tarpaulin' # TODO restore to normal (https://github.com/xd009642/tarpaulin/issues/756#issuecomment-838769320)
57+
# env:
58+
# DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb
59+
# DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb
60+
# LD_LIBRARY_PATH: ${{ github.workspace }}/libduckdb
4661
- name: Upload to codecov.io
4762
uses: codecov/codecov-action@v1
4863

64+
# cargo publish
65+
- uses: wangfenjin/publish-crates@main
66+
name: cargo publish --dry-run
67+
if: startsWith(github.ref, 'refs/tags/') != true
68+
with:
69+
path: './'
70+
args: --allow-dirty --all-features
71+
dry-run: true
72+
ignore-published: true
73+
- uses: wangfenjin/publish-crates@main
74+
name: cargo publish
75+
if: startsWith(github.ref, 'refs/tags/')
76+
with:
77+
path: './'
78+
args: --no-verify --allow-dirty --all-features
79+
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
80+
ignore-published: true
81+
82+
# create release
83+
- name: "Build Changelog"
84+
id: build_changelog
85+
if: startsWith(github.ref, 'refs/tags/')
86+
uses: mikepenz/release-changelog-builder-action@v1
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
4990
sanitizer:
5091
name: Address Sanitizer
5192
needs: test

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "duckdb"
3-
version = "0.1.2"
3+
version = "0.2.4"
44
authors = ["wangfenjin <[email protected]>"]
55
edition = "2018"
66
description = "Ergonomic wrapper for DuckDB"
@@ -65,7 +65,7 @@ rand = "0.8.3"
6565

6666
[dependencies.libduckdb-sys]
6767
path = "libduckdb-sys"
68-
version = "0.1.1"
68+
version = "0.2.4"
6969

7070
[package.metadata.docs.rs]
7171
features = []

libduckdb-sys/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "libduckdb-sys"
3-
version = "0.1.2"
3+
version = "0.2.4"
44
authors = ["wangfenjin <[email protected]>"]
55
edition = "2018"
66
build = "build.rs"

0 commit comments

Comments
 (0)