How to define the charm version in Charmhub?

How to define the charm version when using charmcraft?

When I upload the charm, it gets a new revision and the version is automatically defined, based on the revision:

$ charmcraft upload slurmd.charm
Revision 8 of 'slurmd' created

$ charmcraft release slurmd --revision=8 --channel=edge
Revision 8 of charm 'slurmd' released to edge

$ charmcraft status slurmd
Track    Channel    Version    Revision
latest   stable     5          5
         candidate  5          5
         beta       ↑          ↑
         edge       8          8

Where and how do I specify the version of the charm?

According to theGitHub issues charmcraft#355 and charmcraft#358, to set the charm version you need to create a file named version (all lowercase) in the root directory before invoking charmcraft pack.

Any string is valid:

version

1 Like