2

I started using Conan to handle my C++ code base and I do not understand if it offers a way to automatically increment a package version after uploading a release.

I am talking about something like npm postpublish hook script that I use to execute npm version patch: so I am always sure that after a release, I am working on a new version.

I there any command that updates version field inside my conanfile.py? Is it automatically callable after a deploy?

Marco Stramezzi
  • 1,611
  • 2
  • 11
  • 28

1 Answers1

2

No, there is no auto-incrementing feature for conan. The main reason is that it is not clear that a conan upload necessarily means bumping the version. For example, you might run a conan create to create a x86 binary, then upload it. After that, you create a package binary, exactly with the same recipe and version, for 64bits, x86_64, and upload it.

You don't want to bump to a different version. So bumping the version is done explicitly in the recipe version field. It can also be skipped in the recipe, and just defined in the command line: conan create . pkg/version@user/channel, but it is up to the user to define the version.

A different feature would be the package "revisions". Those will assign a new, transparent revision for each recipe change or binary rebuild. It is an ongoing work, so it might take some time until it is there.

drodri
  • 3,796
  • 10
  • 15