Bumping `Project.toml` version number after tag

This is a really trivial thing, but I’ve yet to find a really good workflow for it.

I always forget to go into my Project.toml and bump the version number of my package after I make a tag. Worse, sometimes I make a tag having forgotten to do this. Is there a recommended workflow for this? Again, it’s really a trivial thing, but modifying Project.toml directly doesn’t really have a place in any of my normal development routines, I’m wondering if I’m missing some obvious and more convenient way of dealing with this.

1 Like

Bump it before just before tag?

1 Like

Like I said, I keep forgetting (though I’m perhaps crossing the threshold where I’ve forgotten enough times that the regret will cause me to remember).

I’m of course not expecting anyone to come along with a magical solution to me just forgetting things, but this felt like a sufficiently awkward step in the workflow that I was wondering if maybe I was missing something. Sounds like that’s not the case.

I guess some kind of a script hook for annotated git tags might be useful to prompt you “have you bumped the version number?!” or so :wink:

1 Like

My flow is: work on stuff, close issues, merge PRs, yada yada. Ok, now I’m ready for a release. Go to web github repo, click on Project.toml, click little pencil in top right to edit, increment version and commit direct to master. This takes me back to main repo page. Click on commit in top status bar that shows the most recent commit, then call @JuliaRegistrator register() on the commit.

It’s worked pretty well; I guess for me, bumping the version is always immediately before I call JuliaRegistrator and it’s all a “web UI” kind of process.

7 Likes

I brought up the same thing on Slack at some point. I wonder if it would be nicer if it were possible to use the commit message of the commit that changes the version number to also trigger JuliaRegistrator (which I don’t think is possible right now, but I could be wrong). That way there’s just a single action you have to take in order to register, rather than the current two-step process.

1 Like

Thank you everyone for giving earnest responses and not making me feel overly stupid for having asked this :laughing:.

I guess it’s really just something I have to get used to in the release process. Part of my discomfort with it probably comes from avoiding tagging on my projects at my job. This’ll probably seem less awkward to me when I am more used to tagging frequently.

I actually have a script in each repo called makerelease.sh which can do patch, minor and major. It basically runs all my tests, bump the version number and then tags it. This works fine for me but I wish I had something to automate a NEWS file for me. :joy:

I’ve been using this to (semi-)automate a release:

By the way, I think automation can be a bit more smoother if Registrator.jl let us use a PR to trigger the release. I know this feature was there once and then got removed due to the concern about missing tree-sha (https://github.com/JuliaRegistries/Registrator.jl/issues/1). But since this mode of failure can be triggered via current @JuliaRegistrator register branch=name-of-your-branch anyway, it would be nice if there is an I-know-what-I’m-doing flag to use a PR.

3 Likes