-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a release script #1748
Add a release script #1748
Conversation
First draft of a release script to automate most of the painful details of releasing a new version of Nickel and associated crates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to have this automated!
Did you see if there's anything useful that cargo release
has to offer? The topiary stuff probably means we can't just use it out-of-the-box, but for example the cargo release version
subcommand might get rid of the version-related sed stuff.
Co-authored-by: jneem <joeneeman@gmail.com>
I haven't looked at it. Thanks for the suggestion, I'll see if it can make some parts of the script simpler! |
This PR adds a script to automate most of of the releasing process (which is becoming tedious).
The steps covered are:
nix flake check
currently)nickel-lang-utils
from dependencies, remove the various format features, remove "format" from default features, and remove the dependencies associated to "format"I've tried to inform the user as much as possible, and to gracefully recover in case of error.
This scripts has been tested by parts (commenting out destructive actions like pushing the stable branch or aborting before actually publishing to crates.io), and in different situations manually. I'd still like to get reviews before using it for the 1.4 release, so that I can try the version including review suggestions in real conditions (and avoid having bugs resurfacing when releasing 1.5).
Afterthought
I initially thought I could use
tomlq
to patch the variousCargo.toml
files in place. It's true in theory, buttomlq
works by parsing content, transcoding to JSON, usingjq
for processing, and transcodes back the result to TOML. Needless to say, even if the result is semantically correct, it totally messes up the original formatting and layout of the files, as well as removing all comments, which is unacceptable.I ended up using
sed
/awk
for modification instead, which is obviously more fragile. Now, if I was to start again, I would consider something like a stand-alone python script (given that there's a library to do what I want, that is localized programmatic modification of TOML). For now this script should be sufficient, but if we need to evolve it in the future, this might be a consideration to keep in mind.TODO
Future work