# tea release create: Publish Gitea Releases in CI

> tea release create publishes a Gitea/Forgejo release and uploads assets. Reference for --tag, --note, --asset, --repo, --login, and the CI errors around them.

Source: https://latchkey.dev/learn/command-reference/tea-release-gitea  
Updated: 2026-06-30

tea release create publishes a release for a tag on a Gitea or Forgejo instance and can attach asset files.

For self-hosted Gitea/Forgejo release automation, tea release create turns a tag into a published release with notes and uploaded binaries, driven entirely by flags.

## What it does

tea release create makes a release bound to a tag, with a title and notes, and uploads any --asset files. It uses the configured tea login for the target instance, so no credentials appear in the command.

## Common usage

```Terminal
# publish a release with notes and a binary asset
tea release create --repo owner/repo \
  --tag v1.2.0 --title "v1.2.0" --note "Automated release" \
  --asset ./dist/app-linux
# list releases
tea release list --repo owner/repo
```

## Options

| Flag | What it does |
| --- | --- |
| --repo owner/repo | Target repository |
| --tag <tag> | Tag the release is attached to |
| --title <t> | Release title |
| --note <text> | Release notes |
| --asset <file> | Upload an asset file (repeatable) |
| --draft / --prerelease | Mark as draft or prerelease |
| --login <name> | Which configured login to use |

## In CI

Supply --tag, --title, and --note so nothing prompts, and repeat --asset per file. Make sure the tag exists (push it first) since tea does not create tags. Pin --login if multiple instances are configured.

## Common errors in CI

"Error: Please specify a repo" means --repo was omitted. "404 Not Found" on --tag means the tag was not pushed. "409 Conflict" or "release already exists" means a release for that tag exists; use tea release edit. "401 Unauthorized" means the login token is invalid or lacks write access.

## Using this in CI

CI checkouts are shallow and detached by default, which changes the answer this command gives you. Commands that read history, branch names, or tags need the checkout configured for it.

```.github/workflows/ci.yml
- uses: actions/checkout@v4
  with:
    fetch-depth: 0   # history, tags, and git describe all need this

- run: |
    git rev-parse --is-shallow-repository   # expect false
    git rev-parse --abbrev-ref HEAD          # prints HEAD when detached
```

> `git rev-parse --abbrev-ref HEAD` returns the literal string `HEAD` on a detached checkout rather than a branch name. On GitHub Actions read `github.ref_name` instead; the git command cannot know what it was checked out for.

## FAQ

### tea release create: Publish Gitea Releases in CI?

For self-hosted Gitea/Forgejo release automation, tea release create turns a tag into a published release with notes and uploaded binaries, driven entirely by flags.

### What it does?

tea release create makes a release bound to a tag, with a title and notes, and uploads any --asset files. It uses the configured tea login for the target instance, so no credentials appear in the command.

### In CI?

Supply --tag, --title, and --note so nothing prompts, and repeat --asset per file. Make sure the tag exists (push it first) since tea does not create tags. Pin --login if multiple instances are configured.

### Common errors in CI?

"Error: Please specify a repo" means --repo was omitted. "404 Not Found" on --tag means the tag was not pushed. "409 Conflict" or "release already exists" means a release for that tag exists; use tea release edit. "401 Unauthorized" means the login token is invalid or lacks write access.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
