Skip to content

Commit 16e68d8

Browse files
chore: prepare 0.19 release (#324)
This commit updates the changelog for the 0.19 release, bumps the crate versions correctly and updates the release procedure.
1 parent abfcd94 commit 16e68d8

File tree

5 files changed

+92
-11
lines changed

5 files changed

+92
-11
lines changed

CHANGELOG.md

Lines changed: 80 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,60 @@
1+
## [](https://github.com/multiformats/rust-multihash/compare/v0.18.0...v0.19.0) (2023-06-06)
2+
3+
4+
### ⚠ BREAKING CHANGES
5+
6+
* the Serde serialization format changed
7+
* split crates into multiple to isolate breaking changes
8+
* `identity` hasher was removed
9+
10+
See the migration section below for help on upgrading.
11+
12+
### Features
13+
14+
* **codetable:** remove `identity` hasher ([#289](https://github.com/multiformats/rust-multihash/issues/289)) ([8473e2f](https://github.com/multiformats/rust-multihash/commit/8473e2f7ecdc0838a3f35d0ecb1935b4c70797c2))
15+
* Serde serialize Multihash in bytes representation ([#302](https://github.com/multiformats/rust-multihash/issues/302)) ([1023226](https://github.com/multiformats/rust-multihash/commit/10232266c01aa83190af62ad6aeebf63bb7a16c7))
16+
17+
18+
### Bug Fixes
19+
20+
* avoid possible panic in error handling code ([#277](https://github.com/multiformats/rust-multihash/issues/277)) ([5dc1dfa](https://github.com/multiformats/rust-multihash/commit/5dc1dfac0235e63e9ad80572e6b73f8fcd301ec3))
21+
* don't panic on non minimal varints ([#291](https://github.com/multiformats/rust-multihash/issues/291)) ([6ef6040](https://github.com/multiformats/rust-multihash/commit/6ef604012b84d5c15d4f3c66a28ead96afedf158)), closes [#282](https://github.com/multiformats/rust-multihash/issues/282)
22+
* expose `MultihashDigest` trait in codetable ([#304](https://github.com/multiformats/rust-multihash/issues/304)) ([50b43cd](https://github.com/multiformats/rust-multihash/commit/50b43cdbba5492923ffb31bb197930d2f3e2cf14))
23+
24+
25+
### Code Refactoring
26+
27+
* split crates into multiple to isolate breaking changes ([#272](https://github.com/multiformats/rust-multihash/issues/272)) ([954e523](https://github.com/multiformats/rust-multihash/commit/954e5233d273a2b7d682fd087178203628d131a4))
28+
129
### Migrating
230

331
When upgrading to `v0.19`, consider the following:
432

5-
- `Code` has moved to `multihash_codetable::Code`.
6-
Either use that or define your own codetable using `multihash_derive`.
33+
- `Code` has moved from `multihash::Code` to `multihash_codetable::Code`. It's strongly recommended to define your own code table using `multihash_derive`. Check the [custom codetable example](codetable/examples/custom_table.rs) on how to use it. For the simplest migration, use the `multihash_codetable::Code`.
34+
35+
**Before**
36+
37+
```rust
38+
use multihash::{Code, MultihashDigest};
39+
40+
fn main() {
41+
let hash = Code::Sha2_256.digest(b"hello, world!");
42+
println!("{:?}", hash);
43+
}
44+
```
45+
46+
**After**
47+
48+
```rust
49+
use multihash_codetable::{Code, MultihashDigest};
50+
51+
fn main() {
52+
let hash = Code::Sha2_256.digest(b"hello, world!");
53+
println!("{:?}", hash);
54+
}
55+
```
56+
57+
If you get compile errors, make sure you have the correct features enabled. In this case it would be the `sha2` and `digest` features.
758

859
- `multihash::Multihash` now requires the size of its internal buffer as a const-generic.
960
You can migrate your existing code by defining the following type-alias:
@@ -13,7 +64,33 @@ When upgrading to `v0.19`, consider the following:
1364
```
1465

1566
- The `identity` hasher has been removed completely.
16-
Check the [identity example](examples/identity.rs) on how to replicate the functionality.
67+
68+
**Before**
69+
70+
```rust
71+
use multihash::{Code, MultihashDigest};
72+
73+
fn main() {
74+
let hash = Code::Identity.digest(b"hello, world!");
75+
println!("{:?}", hash);
76+
}
77+
```
78+
79+
**After**
80+
81+
```rust
82+
use multihash::Multihash;
83+
84+
const IDENTITY_HASH_CODE: u64 = 0x00;
85+
86+
fn main() {
87+
let hash = Multihash::<64>::wrap(IDENTITY_HASH_CODE, b"hello, world!").unwrap();
88+
println!("{:?}", hash);
89+
}
90+
```
91+
92+
Check the [identity example](examples/identity.rs) for more information on how to replicate the functionality.
93+
1794

1895
## [v0.18.1](https://github.com/multiformats/rust-multihash/compare/v0.18.0...v0.18.1) (2023-04-14)
1996

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "multihash"
77
description = "Implementation of the multihash format"
88
repository = "https://github.com/multiformats/rust-multihash"
99
keywords = ["multihash", "ipfs"]
10-
version = "0.18.0"
10+
version = "0.19.0"
1111
authors = ["dignifiedquire <[email protected]>", "David Craven <[email protected]>", "Volker Mische <[email protected]>"]
1212
license = "MIT"
1313
readme = "README.md"

RELEASE.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ becomes:
2424
# [v0.18.0](https://github.com/multiformats/rust-multihash/compare/v0.17.0...v0.18.0) (2022-12-06)
2525
```
2626

27-
## Publishing
27+
Create a pull request with the changelog changes and the correct version bumps to the crates.
2828

29-
Publishing on crates.io, bumping version & generating tags is done using [`cargo-release`](https://github.com/crate-ci/cargo-release).
29+
30+
Publishing
31+
----------
32+
33+
Once the PR above is merged, the crate can be published. This is done using [`cargo-release`](https://github.com/crate-ci/cargo-release).
3034

3135
This requires the following permissions
3236

@@ -39,11 +43,11 @@ This requires the following permissions
3943
Dry run
4044

4145
```sh
42-
$ cargo release <patch|minor|major>
46+
$ cargo release --workspace
4347
```
4448

4549
Actual publishing
4650

4751
```sh
48-
$ cargo release --execute <patch|minor|major>
52+
$ cargo release --workspace --execute
4953
```

codetable/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ sha2 = { version = "0.10.0", default-features = false, optional = true }
2626
sha3 = { version = "0.10.0", default-features = false, optional = true }
2727
strobe-rs = { version = "0.8.1", default-features = false, optional = true }
2828
ripemd = { version = "0.1.1", default-features = false, optional = true }
29-
multihash-derive = { version = "0.8.0", path = "../derive", default-features = false }
29+
multihash-derive = { version = "0.9.0", path = "../derive", default-features = false }
3030
core2 = { version = "0.4.0", default-features = false }
3131
serde = { version = "1.0.158", features = ["derive"], optional = true }
3232

derive/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "multihash-derive"
3-
version = "0.8.1"
3+
version = "0.9.0"
44
edition = "2018"
55
description = "Proc macro for deriving custom multihash tables."
66
license = "MIT"
@@ -12,7 +12,7 @@ std = ["multihash/std", "core2/std"]
1212

1313
[dependencies]
1414
multihash-derive-impl = { version = "0.1.0", path = "../derive-impl" }
15-
multihash = { version = "0.18.0", path = "../", default-features = false }
15+
multihash = { version = "0.19.0", path = "../", default-features = false }
1616
core2 = { version = "0.4.0", default-features = false }
1717

1818
[dev-dependencies]

0 commit comments

Comments
 (0)