Skill v1.0.0
currentLLM-judged scan90/100version: "1.0.0" name: publishing description: Publishing charms to Charmhub (upload, release, channel management)
Publishing to Charmhub
This skill covers the complete workflow for publishing a charm to Charmhub, from validation through upload and release.
Prerequisites
Before publishing, ensure:
- Validation passes — run
charm_validateto confirm unit tests pass and the charm packs successfully - README exists — run
generate_readmeto create a README.md from charm metadata - Charmhub registration — the charm name must be registered on Charmhub (
charmcraft register <name>) - Authentication —
charmcraft loginmust have been run in the environment
Upload Workflow
Step 1: Generate README
generate_readme(path="<charm_dir>")
This reads charmcraft.yaml, WORKLOAD.md, and DESIGN.md to produce a structured README with usage, configuration, actions, and integrations sections.
Step 2: Pack the charm
charmcraft_pack(path="<charm_dir>")
This produces a .charm file ready for upload.
Step 3: Upload to Charmhub
charmcraft_upload(charm_file="<path_to_charm_file>", confirmed=true)
Always confirm with the user before uploading. Show them:
- The charm file being uploaded
- The target Charmhub name
- Any previous revisions
The upload returns a revision number (e.g. Revision 42).
Step 4: Release to a channel
charmcraft_release(name="<charm_name>", revision=42, channel="latest/edge", confirmed=true)
Always confirm with the user before releasing. Show them:
- The charm name and revision
- The target channel
- What channel the revision was previously in (if any)
Channel Strategy
Charmhub uses a track/risk channel system:
| Channel | Purpose | When to release | |
|---|---|---|---|
latest/edge | Development builds | After upload — default starting point | |
latest/beta | Feature-complete builds | After basic integration testing | |
latest/candidate | Release candidates | After full testing, before production | |
latest/stable | Production releases | After candidate validation |
Recommended workflow:
- Upload → release to
latest/edge - Test with
juju deploy <charm> --channel latest/edge - Promote to
latest/betaafter integration tests pass - Promote to
latest/candidateafter broader testing - Promote to
latest/stableafter user approval
To promote between channels, release the same revision to the next channel — no re-upload needed.
Resource Handling
For charms with OCI image resources:
- Upload the OCI image as a Charmhub resource
- Note the resource revision number
- Include resources when releasing:
resources=["oci-image:3"]
Versioning Best Practices
- Use meaningful commit messages — they appear in the Charmhub revision history
- Tag releases in git to match Charmhub revisions
- Document breaking changes in the README and charm description
- Keep
CHANGELOG.mdup to date for each release
Common Issues
- "not registered" — run
charmcraft register <name>first - "not logged in" — run
charmcraft login - "invalid charm" — ensure
charmcraft packsucceeds before uploading - Architectures — ensure the
.charmfile supports the required architectures (checkcharmcraft.yamlbases)