11# Releasing
22
3- Releasing, i.e. crate publishing, has been automated via GitHub Actions.
3+ ## Prerequisites
4+ Publishing to crates.io has been automated via GitHub Actions, so you will only
5+ need push access to the [ ballista-compute GitHub repository] ( https://github.com/ballista-compute/sqlparser-rs )
6+ in order to publish a release.
47
58We use the [ ` cargo release ` ] ( https://github.com/sunng87/cargo-release )
69subcommand to ensure correct versioning. Install via:
@@ -9,29 +12,47 @@ subcommand to ensure correct versioning. Install via:
912$ cargo install cargo-release
1013```
1114
12- ** Before releasing** ensure ` CHANGELOG.md ` is updated appropriately.
13-
1415## Process
1516
16- Using ` cargo-release ` we can author a new minor release like so:
17+ 1 . ** Before releasing** ensure ` CHANGELOG.md ` is updated appropriately and that
18+ you have a clean checkout of the ` main ` branch of the sqlparser repository:
19+ ```
20+ $ git fetch && git status
21+ On branch main
22+ Your branch is up to date with 'upstream/main'.
1723
18- ```
19- $ cargo release minor --skip-publish
20- ```
24+ nothing to commit, working tree clean
25+ ```
26+ * If you have the time, check that the examples in the README are up to date.
2127
22- ** Ensure publishing is skipped** since pushing the resulting tag upstream will
23- handle crate publishing automatically.
28+ 2. Using `cargo-release` we can publish a new release like so:
2429
25- This will create a new tag, ` 0.6.0 ` with the message,
26- ` (cargo-release) sqlparser version 0.6.0 ` .
30+ ```
31+ $ cargo release minor --push-remote upstream
32+ ```
2733
28- Once the tag is created, pushing the tag upstream will trigger a publishing
29- process to crates.io. Now to push our example tag:
34+ You can add `--dry-run` to see what the command is going to do,
35+ or `--skip- push` to stop before actually publishing the release.
3036
31- ```
32- git push origin 0.6.0
33- ```
37+ `cargo release` will then:
38+
39+ * Bump the minor part of the version in `Cargo.toml` (e.g. `0.7.1-alpha.0`
40+ -> `0.8.0`. You can use `patch` instead of `minor`, as appropriate).
41+ * Create a new tag (e.g. `v0.8.0`) locally
42+ * Push the new tag to the specified remote (`upstream` in the above
43+ example), which will trigger a publishing process to crates.io as part of
44+ the [corresponding GitHub Action](https://github.com/ballista-compute/sqlparser-rs/blob/main/.github/workflows/rust.yml).
45+
46+ Note that credentials for authoring in this way are securely stored in
47+ the (GitHub) repo secrets as `CRATE_TOKEN`.
48+ * Bump the crate version again (to something like `0.8.1-alpha.0`) to
49+ indicate the start of new development cycle.
50+
51+ 3. Push the updates to the `main` branch upstream:
52+ ```
53+ $ git push upstream
54+ ```
55+
56+ 4. Check that the new version of the crate is available on crates.io:
57+ https://crates.io/crates/sqlparser
3458
35- (Note that this process is fully automated; credentials
36- for authoring in this way are securely stored in the repo secrets as
37- ` CRATE_TOKEN ` .)
0 commit comments