release.publish¶
Publish a built release: repository, tag, Pages, Docker image, GitHub release.
Every step checks whether it is already done and is skipped then, so a publish
which failed half way is finished by running the command again. The tools are
the real git, gh and docker command line programs, called through a
Runner.
DOCKER_PLATFORM
module-attribute
¶
The platform of the Docker image of a release.
check_tools
¶
check_tools(release_path, runner=run)
Check that the tools of the publishing steps are ready.
The check needs no build, so a release runs it before the build.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
release_path
|
Path
|
the checkout of the release repository. |
required |
runner
|
Runner
|
runs the tool checks. |
run
|
Raises:
| Type | Description |
|---|---|
ReleaseError
|
if Docker or its buildx plugin is not available or |
check_lock
¶
Check that the built project depends on released packages only.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
release_path
|
Path
|
the checkout of the release repository, after the build. |
required |
Raises:
| Type | Description |
|---|---|
ReleaseError
|
if there is no |
head_is_release
¶
head_is_release(path, version, runner=run)
Tell whether the release of a version is committed at HEAD.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
the checkout of the release repository. |
required |
version
|
str
|
the released version. |
required |
runner
|
Runner
|
runs git. |
run
|
Returns:
| Type | Description |
|---|---|
bool
|
|
bool
|
the manifest of |
tag_commit
¶
tag_commit(path, version, runner=run)
Get the commit of the tag of a version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
the checkout of the release repository. |
required |
version
|
str
|
the version, the name of the tag. |
required |
runner
|
Runner
|
runs git. |
run
|
Returns:
| Type | Description |
|---|---|
str | None
|
The commit of |
publish
¶
publish(
settings, release_path, version, archive, runner=run
)
Publish a built release; every step already done is skipped.
The Docker image is built first, so an image which does not build stops the release before anything is published. GitHub Pages is set up before the push, so the docs workflow which the push starts deploys the site.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
settings
|
ReleaseSettings
|
the release settings of the model. |
required |
release_path
|
Path
|
the checkout of the release repository. |
required |
version
|
str
|
the released version. |
required |
archive
|
Path
|
the source archive attached to the GitHub release. |
required |
runner
|
Runner
|
runs git, gh and docker. |
run
|
Returns:
| Type | Description |
|---|---|
list[str]
|
The names of the steps which ran: |
list[str]
|
|
Raises:
| Type | Description |
|---|---|
ReleaseError
|
if a command fails or the tag exists at another commit. |