{"id":16115547,"url":"https://github.com/byron/cargo-smart-release","last_synced_at":"2025-04-12T17:39:30.061Z","repository":{"id":189934760,"uuid":"681604476","full_name":"Byron/cargo-smart-release","owner":"Byron","description":"Release complex cargo-workspaces automatically with changelog generation, used by `gitoxide`","archived":false,"fork":false,"pushed_at":"2024-10-09T14:54:08.000Z","size":1286,"stargazers_count":77,"open_issues_count":13,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-10T20:19:00.401Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Byron.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-22T11:20:57.000Z","updated_at":"2024-10-09T14:54:11.000Z","dependencies_parsed_at":"2023-10-13T08:48:42.227Z","dependency_job_id":"b81e0637-35f3-4a0f-8408-6ad3e35742bd","html_url":"https://github.com/Byron/cargo-smart-release","commit_stats":null,"previous_names":["byron/cargo-smart-release"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Byron%2Fcargo-smart-release","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Byron%2Fcargo-smart-release/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Byron%2Fcargo-smart-release/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Byron%2Fcargo-smart-release/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Byron","download_url":"https://codeload.github.com/Byron/cargo-smart-release/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248606875,"owners_count":21132431,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-09T20:19:06.565Z","updated_at":"2025-04-12T17:39:30.035Z","avatar_url":"https://github.com/Byron.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `cargo smart-release`\n\nFearlessly release workspace crates and with beautiful semi-handcrafted changelogs.\n\n[![asciicast](https://asciinema.org/a/65uPfzoWxGac43zEZ1gQ1yVVe.svg)](https://asciinema.org/a/65uPfzoWxGac43zEZ1gQ1yVVe)\n\n## Key Features\n\n* **zero-configuration**\n  * `cargo smart-release` needs no extra flags to _do the right thing™️_ smartly. If your intervention is needed it will let you know before it makes changes.\n  * It won't do anything if there are no changes.\n* **made for multi-crate workspaces**\n  * \"Nothing stands by itself, and everything is interconnected\" - is how it sees the world, allowing it to efficiently handling complex workspace graphs.\n  * _works just as well for single-crate workspaces_\n* **changelogs-deluxe**\n  * It maintains beautiful changelogs for you while allowing you to edit them for the final polish.\n  * See your release notes via in-repository _tag objects_ and in _GitHub Releases_\n  * **plays well with `cargo release`**\n    * `cargo changelog` writes changelogs non-destructively, and only that, leaving the release workflow to [cargo-release].\n  \nIf seeing is believing, here is [a 12 minute demonstration](https://www.youtube.com/watch?v=EOft_uMDVYE), and the same in 30 minutes is [also available](https://youtu.be/a4CzzxJ7ecE).\n\n## Made for this Workflow\n\nWhen developing various crates in a workspace, when committing changes and if the edit is breaking, a feature, or another\nchange I want to see in changelogs, [conventional] git messages will be used. This helps building changelog scaffolding automatically later.\n\nWhen ready for releasing a particular crate or set of crates of interest, run `cargo smart-release [\u003ccrate-name\u003e ...]` to simulate a release. For particularly thorough\nbut error-prone simulations (as in false positives) one could run `cargo smart-release --dry-run-cargo-publish`. To polish changelogs, run `cargo changelog --write \u003ccrate-name\u003e`\nto update the scaffolding and edit it by hand until it fits.\n\nAfter evaluating the release procedure and following instructions,\n`cargo smart-release --execute` will cause the fully automatic release of one or more crates.\n\nThere are various other options that shouldn't be needed in the common case, use `cargo smart-release --help` to see them.\n\n[conventional]: https://www.conventionalcommits.org\n\n## Installation\n\n### Cargo\nVia `cargo`, which can be obtained using [rustup][rustup]\n\n```\ncargo install cargo-smart-release\n```\n\n## Features\n\n* [x] safe to use as actually performing an operation requires the `--execute` flag\n* [x] avoid inconsistent states by making operations as atomic as possible, leveraging `gitoxide` technology to the fullest\n* [x] handle workspace dependencies and cycles gracefully, allowing one invocation to publish multiple crates\n* [x] avoid making any releases if there are no changes\n* [x] avoid bumping versions if the current version isn't released, allowing you to control the version by editing the cargo manifest\n* [x] [conventional] commit message drive changelog scaffolding and to automatically derive the crate version to publish\n* [x] automatically release dependent workspace IDP crates along with the desired one if they changed since their last release\n* [x] automatically adjust manifest versions and update manifests of crates which use those whose versions were incremented\n* [x] conservatively bump downstream workspace crates in the light of breaking changes, even though these won't be published, making downstream breakage impossible\n* [x] use git tags to know if a crate changed at all, skipping publishes if there is no code change at all\n* [ ] it's _too eager_ to release and there should be a way to control patch releases.\n* [ ] Handle pre-release versions, like 1.0.0-beta.1\n* [ ] Support other remote names than 'origin' - currently the latter name is assumed. Fix by getting the remote of the currently checked out branch.\n* [ ] handle version specifications correctly [(tables vs values)](https://github.com/Byron/cargo-release/blob/master/src/cargo.rs#L179:L207)\n* [ ] handle all version comparators correctly (see [here](https://github.com/Byron/cargo-release/blob/master/src/version.rs#L192:L226) for how it's done)\n* [ ] Automatically detect if crate changes are breaking to suggest the correct version increment\n\n## Comparison to `cargo release`\n\n`cargo-release` is the reason this tool exists, as it got me addicted to an all automatic release workflow that knows git. This works perfectly\nfor simple workspaces or single-crate workspaces, as of 2021-08-12, so use it: `cargo install cargo-release`.\n\nHere is what `cargo smart-release` does differently: \"It tries really hard to do what _I_ want most of the time when publishing workspace `gitoxide` crates\".\n\n- ~~be safe to execute, so it's disarmed by default~~\n- specify one or more crates, and detect which crates need publishing automatically\n- handle dependency cycles in such a way that increases the chances of overall success\n- try really hard to not leave the workspace in an inconsistent state when something goes wrong\n- be a playground for `gitoxide` to have a reason to make it much more convenient and more feasible for application authors (aka dog-fooding)\n- create changelogs non-destructively, along with annotated tags and GitHub releases\n\n## Limitations\n\n* it requires tables to be used when specifying versions, i.e. `crate = { version = \"1\" }` instead of `crate  = \"1\".\n* it gracefully fails when encountering version requirement comparators which are not `^`, like `=`\n* it's tested only by using it on `gitoxide`, there are only very few regression tests with little coverage.\n* short object ids in changelogs may be ambiguous, as they are unconditionally truncated to 7 characters.\n* changelog rewriting of user content will drop links if they are not of the 'inline' form\n* it's very young and probably tries to eat underwear\n* it needs a git repository to govern the workspace\n\n### Changelogs\n\n* When determining if something changed in top-level crates, only the `src/` directory is used, unless there is only a single crate in the workspace. This value is hard-coded.\n* For change tracking, it will only obtain manifest values once to know where a crate lives, and\n  expects it to not be moved.\n* If list items populated by commit messages contain items themselves, round-tripping will fail. Ideally there was a way to parse an item on the same level only.\n\n## Acknowledgements\n\nThanks to [cargo-release] for showing the way and for incredible fast response times. I'd recommend everyone to participate there instead of writing your own.\n\nSpecial thanks go to [git-cliff] which gave me the nudge needed to want to write my own.\n\n[cargo-release]: https://github.com/sunng87/cargo-release/issues/224\n[git-cliff]: https://github.com/orhun/git-cliff\n[rustup]: https://rustup.rs/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyron%2Fcargo-smart-release","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyron%2Fcargo-smart-release","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyron%2Fcargo-smart-release/lists"}