15. Set up charm compatibility version
Prerequisites
The charm must use Poetry to manage Python dependencies.
charmcraft.yaml must contain a poetry-deps
part that installs Poetry and makes the poetry
command available.
Does the charm not use Poetry? Follow these instructions |
Use reusable workflow
Follow the instructions to use canonical/data-platform-workflows' release_charm_edge.yaml workflow.
Ensure the tag
job is included.
Update charmcraft.yaml
Add the following configuration to the files
part.
If the files
part does not exist, create it.
Example charmcraft.yaml
parts:
# "files" part name is arbitrary; use for consistency
files:
plugin: dump
source: .
after:
- poetry-deps # Ensure poetry is installed
build-packages:
- git
override-build: |
# Set `charm_version` in refresh_versions.toml from git tag
# Create venv in `..` so that git working tree is not dirty
python3 -m venv ../refresh-version-venv
source ../refresh-version-venv/bin/activate
poetry install --only build-refresh-version
write-charm-version
craftctl default
stage:
- LICENSE
- refresh_versions.toml