From 979e4abb6b53915d12e9dac3e9b3a4ce48e440d8 Mon Sep 17 00:00:00 2001 From: Max Inden Date: Tue, 18 Aug 2020 13:04:21 +0200 Subject: [PATCH 1/6] docs/release.md: Add release documentation --- docs/release.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 docs/release.md diff --git a/docs/release.md b/docs/release.md new file mode 100644 index 00000000000..fbd548f66dd --- /dev/null +++ b/docs/release.md @@ -0,0 +1,45 @@ +# Release Process + +This project follows [semantic versioning](https://semver.org/). The following +documentation will refer to `X.Y.Z` as _major_, _minor_ and _patch_ version. + +## Before the Release + +- Every substantial pull request should add an entry to the `[unreleased]` + section of the corresponding crate `CHANGELOG.md` file. See + [#1698](https://github.com/libp2p/rust-libp2p/pull/1698/files) as an example. + + In case there is no `[unreleased]` section yet, create one with an increased + major, minor or patch version depending on your change. In addition update the + corresponding entry of the crate in the root level `Cargo.toml`. + + +## Cutting a Release + +1. For each crate's `CHANGELOG.md` including the top level `libp2p` crate + replace `# X.Y.Z [unreleased]` with `# X.Y.Z [yyyy-mm-dd]` and create a + combined pull request against the rust-libp2p `master` branch. + +2. Once merged, create and push a tag for each updated crate. + + ``` + $ tag="-X.Y.Z" + $ git tag -s "${tag}" -m "${tag}" + $ git push origin "${tag}" + ``` + +3. Create and push a tag for the top level `libp2p` crate. + + ``` + # Note the additional `v` here. + $ tag="vX.Y.Z" + $ git tag -s "${tag}" -m "${tag}" + $ git push origin "${tag}" + ``` + +4. Publish each crate including the top level `libp2p` crate to crates.io. + + ``` + cd + cargo publish + ``` From bb6fae7db3ad945320c2ef347dcba44268e43d92 Mon Sep 17 00:00:00 2001 From: Max Inden Date: Tue, 18 Aug 2020 14:18:05 +0200 Subject: [PATCH 2/6] docs/release.md: Address comments --- docs/release.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/docs/release.md b/docs/release.md index fbd548f66dd..3219805ec0f 100644 --- a/docs/release.md +++ b/docs/release.md @@ -1,9 +1,9 @@ -# Release Process +# Release process This project follows [semantic versioning](https://semver.org/). The following documentation will refer to `X.Y.Z` as _major_, _minor_ and _patch_ version. -## Before the Release +## Development between releases - Every substantial pull request should add an entry to the `[unreleased]` section of the corresponding crate `CHANGELOG.md` file. See @@ -14,12 +14,13 @@ documentation will refer to `X.Y.Z` as _major_, _minor_ and _patch_ version. corresponding entry of the crate in the root level `Cargo.toml`. -## Cutting a Release +## Releasing one or more crates + +1. Set the release date for each crate to be released in the respective + `CHANGELOG.md` by replacing `# X.Y.Z [unreleased]` with + `# X.Y.Z [yyyy-mm-dd]` and create a pull request against the rust-libp2p + `master` branch. -1. For each crate's `CHANGELOG.md` including the top level `libp2p` crate - replace `# X.Y.Z [unreleased]` with `# X.Y.Z [yyyy-mm-dd]` and create a - combined pull request against the rust-libp2p `master` branch. - 2. Once merged, create and push a tag for each updated crate. ``` @@ -28,7 +29,8 @@ documentation will refer to `X.Y.Z` as _major_, _minor_ and _patch_ version. $ git push origin "${tag}" ``` -3. Create and push a tag for the top level `libp2p` crate. +3. Create and push a tag for the top level `libp2p` crate, if it is being + released. ``` # Note the additional `v` here. @@ -37,7 +39,8 @@ documentation will refer to `X.Y.Z` as _major_, _minor_ and _patch_ version. $ git push origin "${tag}" ``` -4. Publish each crate including the top level `libp2p` crate to crates.io. +4. Publish each tagged crate to crates.io. `cargo` assists in getting the order + of the releases correct. ``` cd From 92cf51de4cd82229271cc14ba3a9842036d107f6 Mon Sep 17 00:00:00 2001 From: Max Inden Date: Tue, 18 Aug 2020 14:53:36 +0200 Subject: [PATCH 3/6] docs/release.md: Add annotation -a option --- docs/release.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/release.md b/docs/release.md index 3219805ec0f..9aa8ba4a4ea 100644 --- a/docs/release.md +++ b/docs/release.md @@ -25,6 +25,7 @@ documentation will refer to `X.Y.Z` as _major_, _minor_ and _patch_ version. ``` $ tag="-X.Y.Z" + # Use `-s` for a GPG signed tag or `-a` for an annotated tag. $ git tag -s "${tag}" -m "${tag}" $ git push origin "${tag}" ``` From da2ebb0d8dd11365dd85d10471517ade83322de1 Mon Sep 17 00:00:00 2001 From: Max Inden Date: Tue, 18 Aug 2020 15:30:19 +0200 Subject: [PATCH 4/6] docs/release: Mention bumping Cargo.toml version --- docs/release.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/release.md b/docs/release.md index 9aa8ba4a4ea..84d20f930d2 100644 --- a/docs/release.md +++ b/docs/release.md @@ -11,7 +11,8 @@ documentation will refer to `X.Y.Z` as _major_, _minor_ and _patch_ version. In case there is no `[unreleased]` section yet, create one with an increased major, minor or patch version depending on your change. In addition update the - corresponding entry of the crate in the root level `Cargo.toml`. + version in the crate's `Cargo.toml` as well as the corresponding entry of the + crate in the root level `Cargo.toml`. ## Releasing one or more crates From 7e94ea351202276c08e0690b20300f4517cd419e Mon Sep 17 00:00:00 2001 From: Max Inden Date: Tue, 18 Aug 2020 16:12:31 +0200 Subject: [PATCH 5/6] docs/release.md: Extract name and version with sed --- docs/release.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/release.md b/docs/release.md index 84d20f930d2..1fee32d6a82 100644 --- a/docs/release.md +++ b/docs/release.md @@ -24,21 +24,23 @@ documentation will refer to `X.Y.Z` as _major_, _minor_ and _patch_ version. 2. Once merged, create and push a tag for each updated crate. - ``` - $ tag="-X.Y.Z" + ```bash + cd $CRATE-PATH + tag="$(sed -En 's/^name = \"(.*)\"$/\1/p' Cargo.toml)-$(sed -En 's/^version = \"(.*)\"$/\1/p' Cargo.toml)" # Use `-s` for a GPG signed tag or `-a` for an annotated tag. - $ git tag -s "${tag}" -m "${tag}" - $ git push origin "${tag}" + git tag -s "${tag}" -m "${tag}" + git push origin "${tag}" ``` 3. Create and push a tag for the top level `libp2p` crate, if it is being released. - ``` + ```bash + cd $REPOSITORY-ROOT # Note the additional `v` here. - $ tag="vX.Y.Z" - $ git tag -s "${tag}" -m "${tag}" - $ git push origin "${tag}" + tag="v$(sed -En 's/^version = \"(.*)\"$/\1/p' Cargo.toml)" + git tag -s "${tag}" -m "${tag}" + git push origin "${tag}" ``` 4. Publish each tagged crate to crates.io. `cargo` assists in getting the order From 17eda9542f065ffae6e7d460699cf033a9e842f2 Mon Sep 17 00:00:00 2001 From: Max Inden Date: Mon, 24 Aug 2020 12:24:26 +0200 Subject: [PATCH 6/6] docs/release.md: Remove instruction for release date in changelog --- docs/release.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/release.md b/docs/release.md index 1fee32d6a82..09b14aa7e7d 100644 --- a/docs/release.md +++ b/docs/release.md @@ -17,10 +17,9 @@ documentation will refer to `X.Y.Z` as _major_, _minor_ and _patch_ version. ## Releasing one or more crates -1. Set the release date for each crate to be released in the respective - `CHANGELOG.md` by replacing `# X.Y.Z [unreleased]` with - `# X.Y.Z [yyyy-mm-dd]` and create a pull request against the rust-libp2p - `master` branch. +1. Remove the `[unreleased]` tag for each crate to be released in the respective + `CHANGELOG.md` and create a pull request against the rust-libp2p `master` + branch. 2. Once merged, create and push a tag for each updated crate.