|
| 1 | +How to release a new version of monetdb-rust |
| 2 | +============================================ |
| 3 | + |
| 4 | +To prepare for the release, first make sure [CHANGELOG.md] contains all relevant |
| 5 | +changes, the documentation is tidy, CI is clean, etc. etc. Script |
| 6 | +`checklicense.py` can be used to check if all files contain a copyright notice. |
| 7 | + |
| 8 | +Note: there is no need to add a new section header to [CHANGELOG.md], the |
| 9 | +scripts will do that. |
| 10 | + |
| 11 | +Then use [cargo release] to create a new section in in [CHANGELOG.md], bump the |
| 12 | +version number in Cargo.toml, create a Git tag, publish the crate on [crates.io] |
| 13 | +and push the tag to GitHub. This can be done with a single command, e.g., |
| 14 | +`cargo release minor`, but you can also let it perform the steps separately. See |
| 15 | +Section [Steps](#steps) below. |
| 16 | + |
| 17 | +Note: until we are a bit more experienced, the automated 'publish' and 'push' steps have been disabled and must be performed manually. |
| 18 | + |
| 19 | +When this is done, use `cargo release alpha` to switch the main branch back to a |
| 20 | +development version number. For example, after releasing version 0.7.10, `cargo |
| 21 | +release alpha` bumps to version 0.7.11-alpha.1. Push this commit to GitHub too, |
| 22 | +but do not tag it. |
| 23 | + |
| 24 | +Also, you need to manually create a GitHub release from the tag, |
| 25 | +with text copy-pasted from [CHANGELOG.md]. |
| 26 | +I don't think [cargo release] can automate that. |
| 27 | + |
| 28 | + |
| 29 | +Steps |
| 30 | +----- |
| 31 | + |
| 32 | +The configuration file for [cargo release] is [release.toml]. |
| 33 | +When in doubt, check the [documentation][cargo release docs]. |
| 34 | + |
| 35 | +When you run for example `cargo release minor`, [cargo release] will perform all |
| 36 | +steps below. The command to run individual steps is noted in the stepTo execute |
| 37 | +individual steps, write `cargo release version <version>`, `cargo release |
| 38 | +replace`, etc. You can also perform these actions by hand if that feels safer. |
| 39 | + |
| 40 | +1. `cargo release version <major|minor|patch|alpha>`. Bumps the version number in |
| 41 | + Cargo.toml. |
| 42 | + |
| 43 | +2. `cargo release replace`. Adds a section for this version to [CHANGELOG.md], containing |
| 44 | + the items that used to be in section "NEXTVERSION". |
| 45 | + |
| 46 | +3. `cargo release hook`. Runs the pre-release hooks configured in [release.toml]. |
| 47 | + At the time of writing, this checks the copyright messages. |
| 48 | + |
| 49 | +4. `cargo release commit`. Commits the changed version number and the updated |
| 50 | + CHANGELOG.md. The commit message is configured in [release.toml]. |
| 51 | + |
| 52 | +5. `cargo release publish`. Currently disabled in [release.toml], runs `cargo |
| 53 | + publish`. Before running this, set env var `CARGO_REGISTRY_TOKEN` |
| 54 | + to a token obtained from `cargo login` or https://crates.io/me. |
| 55 | + |
| 56 | +6. `cargo release tag`. Creates a tag `vMAJOR.MINOR.PATCH`. |
| 57 | + |
| 58 | +7. `cargo release push`. Pushes the commits to GitHub. Currently disabled in |
| 59 | + [release.toml]. |
| 60 | + |
| 61 | + |
| 62 | +[cargo release]: https://github.com/crate-ci/cargo-release |
| 63 | +[cargo release docs]: https://github.com/crate-ci/cargo-release/blob/master/docs/reference.md |
| 64 | +[CHANGELOG.md]: ../CHANGELOG.md |
| 65 | +[crates.io]: https://crates.io |
| 66 | +[release.toml]: ../release.toml |
0 commit comments