Gitea Release
| source | condition | target |
|---|---|---|
✔ | ✔ | ✔ |
Description
The gitea/release resource works with the releases published on a Gitea repository.
- source
Returns the release matching
versionfilter.- condition
Tests that a release exists for the repository.
- target
Creates the release when one does not already exist for the tag. This is one of the few resources that publish something rather than edit a file.
Note | An scm attached to a condition is ignored, with a warning. The lookup always goes to the Gitea API. |
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| age | object | “age” defines the minimum and maximum age of a release to be considered valid. compatible:
remark:
example:
| |
| maximum | string | “maximum” defines the maximum age a release may have to be considered. remark:
example:
| |
| minimum | string | “minimum” defines the minimum age a release must have to be considered. remark:
example:
| |
| commitish | string | “commitish” defines the commit-ish used to create the release tag, such as a branch name or a commit sha. compatible:
default: main example:
| |
| description | string | “description” defines the description of the release. compatible:
remark:
| |
| draft | boolean | “draft” defines whether the release is a draft. compatible:
default: false | |
| owner | string | “owner” defines the owner of the Gitea repository. compatible:
example:
| |
| prerelease | boolean | “prerelease” defines whether the release is a pre-release. compatible:
default: false | |
| repository | string | “repository” defines the name of the Gitea repository for a specific owner. compatible:
example:
| |
| tag | string | “tag” defines the tag of the Gitea release. compatible:
default: the output of the associated source. example:
| |
| title | string | “title” defines the title of the Gitea release. compatible:
default: the value of “tag”. | |
| token | string | “token” defines the credential used to authenticate with the Gitea API. remark:
| |
| url | string | “url” defines the Gitea url to interact with. remark:
example:
| |
| username | string | “username” defines the username used to authenticate with the Gitea API. remark:
| |
| versionfilter | object | “versionfilter” defines the version pattern and kind used to select a release tag. compatible:
default: kind: latest remark:
example:
| |
| kind | string | “kind” defines the versioning scheme used to select a version. default: latest remark:
example:
| |
| pattern | string | “pattern” defines the version pattern, according to “kind”. default:
remark:
example:
| |
| regex | string | “regex” defines the regular expression extracting the version from each entry. remark:
example:
| |
| replaceall | object | “replaceall” applies a regular expression replacement to each version before filtering. remark:
example: turns “curl-8_15_0” into “curl-8.15.0”. | |
| strict | boolean | “strict” enforces strict semantic versioning rules when parsing versions. default: false remark:
|
owner and repository are mandatory. url points at your Gitea instance, e.g. try.gitea.io. There is no default.
Creating a release
These fields apply to a target, and two of them have defaults that are easy to trip over:
| Field | Behaviour |
|---|---|
| The tag the release points at. Defaults to the source output. |
| The release title. Defaults to the tag, so an untitled release is named after its version. |
| The branch or commit the tag is created from. Defaults to |
| The release body. |
| Publish as a draft. |
| Flag the release as a pre-release. |
A release that already exists is left untouched (the target neither updates its title nor its description).
Authentication
token authenticates against the Gitea API. It is sensitive, so read it from the environment or a SOPS file rather than writing it into the manifest:
spec:
url: try.gitea.io
token: '{{ requiredEnv "GITEA_TOKEN" }}'
owner: updatecli
repository: updatecliA source or condition on a public repository needs no credential. Creating a release needs write access.
Example
# updatecli.yaml
name: Show Gitea release usage
sources:
default:
name: Retrieve latest release matching versionfilter rule
kind: gitea/release
spec:
url: "try.gitea.io"
owner: olblak
repository: updatecli-test
versionfilter:
kind: semver
pattern: "~0"
conditions:
default:
name: Test that release "0.0.2" exist
kind: gitea/release
spec:
url: "try.gitea.io"
owner: olblak
repository: updatecli-test
tag: "0.0.2"
sourcedefault:
name: Test that release retrieved from source 'default' exist
kind: gitea/release
sourceid: default
spec:
url: "try.gitea.io"
owner: olblak
repository: updatecli-test
targets:
default:
name: "Ensure release 0.0.1 from branch main exist"
kind: gitea/release
spec:
url: "try.gitea.io"
owner: olblak
repository: updatecli-test
commitish: main
token: xxx
tag: "0.0.1"
sourcedefault:
name: "Ensure release where tag is retrieved from source 'default' from branch main exist"
kind: gitea/release
sourceid: default
spec:
url: "try.gitea.io"
owner: olblak
repository: updatecli-test
token: xxx
commitish: main
Links
The
giteascm - to clone and push