axodotdev / cargo-dist

📦 shippable application packaging
https://axodotdev.github.io/cargo-dist/
Apache License 2.0
1.52k stars 72 forks source link

Allow customizing Github release title #631

Open LucasPickering opened 11 months ago

LucasPickering commented 11 months ago

It'd be nice if you could customize the format of the title of each generated Github release. Currently, it looks like it pulls the title from the changelog if available, and uses the format x.y.z - yyyy-mm-dd. If there's no changelog, it just uses the git tag. I'm not 100% sure on that though, just my observation.

I'd like to customize that so the title is always in the format vx.y.z. I read through announce.rs a bit and didn't see an obvious place where this could be done, but I could take a crack at it with some direction.

mistydemeo commented 11 months ago

That's right, those are the places we get it from. We don't necessarily use the .y.z - yyyy-mm-dd format though; if we find a changelog entry matching the release version, we use that line whatever it is. For example, if we found a changelog line called "v0.6.0 - blah", we'd make a release with that title.

Just so I check what you need - is your goal to try to decouple the format from the changelog? Or is it just that you're interested in a specific release title, whatever route it takes to get there?

Thanks very much for offering to help out on this, by the way!

LucasPickering commented 11 months ago

@mistydemeo Yes, the goal is to decouple the title format from the changelog. I'm not sure exactly what the design would look like, but I'm imagining something similar to Pre-release Replacements in cargo-release, where a format can be defined in Cargo.toml. Here's an example:

# Cargo.toml
[workspace.meta.dist]
release-title = "v{{version}}"

A few fields that I could imaging supporting here, based on the list in cargo-release:

As far as implementation, it looks like cargo-release uses a very simple replacement technique, no templating libraries necessary.

ashleygwilliams commented 5 months ago

may be related to #1098