git_tag
git_tag creates a tag in an existing project-relative Git repository and returns a dependency. It creates a lightweight tag unless message is provided. Repeated creation at the same target succeeds without changing the existing tag.
Tag signing requires a go-git object-signer plugin, which xx does not currently provide; disable tag.gpgSign when creating annotated tags.
Arguments
| Argument | Required | Description |
|---|---|---|
name | Yes | Tag name without the refs/tags/ prefix. |
repository | No | Project-relative Git repository directory. Defaults to .. |
revision | No | Commit revision to tag. Defaults to HEAD. |
message | No | Annotation message. Providing it creates an annotated tag. |
tagger_name | No | Annotated tagger name. Must be used with tagger_email and message. Defaults to Git configuration. |
tagger_email | No | Annotated tagger email. Must be used with tagger_name and message. Defaults to Git configuration. |
force | No | Replace an existing tag, including one at the same target. Defaults to False. |
deps | No | Dependencies to complete before creating the tag. |
Example
load("@git@1", "git_commit", "git_push", "git_tag")
commit = git_commit(
repository=".xx/output",
message="Prepare release",
deps=[generate],
)
tag = git_tag(
repository=".xx/output",
name="v1.0.0",
message="Release v1.0.0",
deps=[commit],
)
git_push(
repository=".xx/output",
tags=True,
deps=[tag],
)