← Back to issue list

How to set the charm version?

View original Github issue

Metadata

Project
charmcraft
Number
#358
Type
issue
State
closed
Author
heitorPB
Labels
—
Created
Updated
Closed

Current evaluation

Usage question resolved: Charmcraft reads the charm version from a file named "version"; no code fix was needed.

Resolution: closed not a bug

Reason: Maintainer facundobatista explained on 2021-06-03 that the version should be included in a file named "version", and the author acknowledged the answer.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Using the operator framework, I can set the workload version, that is displayed with `juju status`, which is not the same as the version when `charmcraft pack` runs. I can use an arbitrary string for the workload version, but how do I set the charm version using `charmcraft`? I see the `revision` is updated automatically on `charmcraft upload`, but it also automatically set my charm version to the same value.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed not a bug Usage question resolved: Charmcraft reads the charm version from a file named "version"; no code fix was needed.
stealth/space-bunny-alpha — closed not a bug Closed as a usage question: maintainer facundobatista explained that the charm version must be supplied in a file named "version"; no code change was needed.
stealth/space-bunny-alpha — closed not a bug Usage question: maintainer facundobatista answered that the charm version must be put in a file named 'version'; the reporter confirmed it worked and the issue was closed with no code change.
stealth/space-bunny-alpha — closed not a bug Closed as a usage question: maintainer facundobatista explained that the charm version must be supplied in a file named "version"; no code change was needed.
stealth/space-bunny-alpha — closed not a bug Maintainer facundobatista explained that the charm version belongs in a file named version; the author confirmed this answered the configuration question.
stealth/space-bunny-alpha — closed not a bug A maintainer explained that charm authors set the charm version in a version file; the reporter confirmed the answer solved their question.
stealth/space-bunny-alpha — closed not a bug Maintainer clarified that Charmcraft reads the charm version from a `version` file; `revision` is separate. The reporter confirmed the answer, and no code change was needed.
qwen3.6-35b-a3b-mtp-q6 — — Closed after a maintainer explained that the charm version is set by creating a file named version containing the desired string. The user confirmed the solution, resolving the question without code changes.
qwen/qwen3.6-35b-a3b — — Resolved via maintainer clarification. To set the charm version in charmcraft, place the version string in a file named version. The issue was closed after the contributor acknowledged the solution.
qwen/qwen3.6-35b-a3b — — Resolved. Maintainers clarified that setting the charm version requires creating a file named version containing the desired string. The issue was closed after the author confirmed the solution.
qwen3.6-35b-a3b-mtp-q6 — — Resolved via maintainer guidance. The charm version is configured by placing a plain text file named version in the charm directory. No code modifications were needed.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1101 add a "version" option on charmcraft release cli charmcraft closed Rejected: Charmhub only obtains a charm’s version from the built artifact, so Charmcraft did not add a release version option; metadata-based versioning remains separate work.
78%
#1790 Set a charm version from `charmcraft.yaml` charmcraft open Maintainer request to accept a `version` field in charmcraft.yaml and store it in the built charm. Unimplemented: the model accepts `version` but it is hidden from the schema and unused. Blocked on design of where version lives.
77%
#37 Populate the 'version' file as part of 'charmcraft build' charmcraft closed Automatic version-file generation was rejected; maintainers directed authors to create version in their build pipeline, which Charmcraft preserves in packed charms.
77%