Skip to content

Commit ec41014

Browse files
authored
chore: update releasing documentation (#1807)
* chore: update releasing documentation * address comments
1 parent a09d453 commit ec41014

File tree

1 file changed

+32
-50
lines changed

1 file changed

+32
-50
lines changed

CONTRIBUTING.md

Lines changed: 32 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -399,58 +399,40 @@ Since the Tonic project consists of a number of crates, many of which depend on
399399
each other, releasing new versions to crates.io can involve some complexities.
400400
When releasing a new version of a crate, follow these steps:
401401

402-
1. **Ensure that the release crate has no path dependencies.** When the HEAD
403-
version of a Tonic crate requires unreleased changes in another Tonic crate,
404-
the crates.io dependency on the second crate will be replaced with a path
405-
dependency. Crates with path dependencies cannot be published, so before
406-
publishing the dependent crate, any path dependencies must also be published.
407-
This should be done through a form of depth-first tree traversal:
408-
409-
1. Starting with the first path dependency in the crate to be released,
410-
inspect the `Cargo.toml` for the dependency. If the dependency has any
411-
path dependencies of its own, repeat this step with the first such
412-
dependency.
413-
2. Begin the release process for the path dependency.
414-
3. Once the path dependency has been published to crates.io, update the
415-
dependent crate to depend on the crates.io version.
416-
4. When all path dependencies have been published, the dependent crate may
417-
be published.
418-
419-
To verify that a crate is ready to publish, run:
420-
421-
```bash
422-
cd <CRATE NAME>
423-
cargo publish --dry-run -p <CRATE NAME>
402+
1. First you must pick the correct version to release, if there are breaking
403+
changes make sure to select a semver compatible version bump.
404+
405+
2. In general, tonic tries to keep all crates at the same version to make it
406+
easy to release and figure out what sub crates you need that will work with
407+
the core version of tonic. To prepare a release branch you can follow the
408+
commands below:
409+
```
410+
git checkout -b <release-branch-name>
411+
./prepare-release.sh <version> # where version is X.Y.Z
412+
```
413+
414+
3. Once all the crate versions have been updated its time to update the
415+
changelog. Tonic uses `conventional-changelog` and it's cli to generate the
416+
changelog.
417+
424418
```
419+
conventional-changelog -p angular -i CHANGELOG.md -s
420+
```
421+
422+
Once the entries have been generated, you must edit the `CHANGELOG.md` file
423+
to add the version and tag to the title and edit any changelog entries. You
424+
must also add any breaking changes here as sometimes they get lost.
425+
426+
4. Once the changelog has been updated you can now create a `chore: release
427+
vX.Y.Z` commit and push the release branch and open a release PR.
425428

426-
2. **Update Cargo metadata.** After releasing any path dependencies, update the
427-
`version` field in `Cargo.toml` to the new version, and the `documentation`
428-
field to the docs.rs URL of the new version.
429-
3. **Update other documentation links.** Update the `#![doc(html_root_url)]`
430-
attribute in the crate's `lib.rs` and the "Documentation" link in the crate's
431-
`README.md` to point to the docs.rs URL of the new version.
432-
4. **Update the changelog for the crate.** Each crate in the Tokio repository
433-
has its own `CHANGELOG.md` in that crate's subdirectory. Any changes to that
434-
crate since the last release should be added to the changelog. Change
435-
descriptions may be taken from the Git history, but should be edited to
436-
ensure a consistent format, based on [Keep A Changelog][keep-a-changelog].
437-
Other entries in that crate's changelog may also be used for reference.
438-
5. **Perform a final audit for breaking changes.** Compare the HEAD version of
439-
crate with the Git tag for the most recent release version. If there are any
440-
breaking API changes, determine if those changes can be made without breaking
441-
existing APIs. If so, resolve those issues. Otherwise, if it is necessary to
442-
make a breaking release, update the version numbers to reflect this.
443-
6. **Open a pull request with your changes.** Once that pull request has been
444-
approved by a maintainer and the pull request has been merged, continue to
445-
the next step.
446-
7. **Release the crate.** Run the following command:
447-
448-
```bash
449-
cd <CRATE NAME>
450-
cargo publish --dry-run -p <CRATE NAME>
429+
5. Once the release PR has been approved and merged into `master` the following
430+
command will release those changes.
431+
432+
```
433+
./publish-release.sh
451434
```
452435

453-
Your editor and prompt you to edit a message for the tag. Copy the changelog
454-
entry for that release version into your editor and close the window.
436+
6. Once all the crates have been released you now must create a release on
437+
github using the text from the changelog.
455438

456-
[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog/blob/master/CHANGELOG.md

0 commit comments

Comments
 (0)