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 |
|---|---|---|---|
| commitish | string | [T] commitish defines the commit-ish such as main | |
| description | string | [T] description defines if the new release description | |
| draft | boolean | [T] draft defines if the release is a draft release | |
| owner | string | [S][C][T] owner specifies the repository owner | |
| prerelease | boolean | [T] prerelease defines if the release is a pre-release release | |
| repository | string | [S][C][T] repository specifies the name of a repository for a specific owner | |
| tag | string | [C][T] tag defines the Gitea release tag. | |
| title | string | [T] title defines the Gitea release title. | |
| token | string | “token” specifies the credential used to authenticate with Gitea API remark: A token is a sensitive information, it’s recommended to not set this value directly in the configuration file but to use an environment variable or a SOPS file. The value can be set to For more information, about a SOPS file, please refer to the following documentation: https://github.com/getsops/sops | |
| url | string | “url” defines the Gitea url to interact with | |
| username | string | “username” defines the username used to authenticate with Gitea API | |
| versionfilter | object | [S] versionfilter provides parameters to specify version pattern and its type like regex, semver, or just latest. | |
| kind | string | specifies the version kind such as semver, regex, or latest | |
| pattern | string | specifies the version pattern according the version kind for semver, it is a semver constraint for regex, it is a regex pattern for time, it is a date format | |
| regex | string | specifies the regex pattern, used for regex/semver and regex/time. Output of the first capture group will be used. | |
| replaceall | object | replaceAll applies a regex replacement to version strings before filtering. This is useful for transforming versions (e.g., curl-8_15_0 to curl-8.15.0) before regex extraction. | |
| strict | boolean | strict enforce strict versioning rule. Only used for semantic versioning at this time |
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