Reputation: 113
At the time I'm writing this, stackoverflow.com delivers no questions that have the tags '[semantic-versioning] [git] [conan]'.
When developing C/C++ projects (applications and libraries) with git and conan, we're working on two systems at the same time:
On the git side, we have branches, checkins, merges, tags; pull and push.
On the conan side, we have semantic versions, dependencies; packages (i. e. a library) advance their semantic version; install new packages in the cache and publishing them to the conan server; dependent packages (i. e. an app that uses the library) have their dependencies upgraded as soon as possible.
What's the workflow to link these two systems? What action on one side should trigger an appropriate action on the opposite side?
Upvotes: 0
Views: 314
Reputation: 5972
The way to link both systems is a typical CI problem. The CI receives a commit in a branch or a PR, that it decides should build a package from it, and then launches a conan create
or similar process.
If the question is how to get Conan to automatically gets its version from some scm convention, like the tag, then it is possible to resort to the set_version()
method, something like
def set_version(self):
git = tools.Git()
self.version = "%s_%s" % (git.get_branch(), git.get_revision())
check the conan docs reference or this howto
Upvotes: 1