`gt upgrade --nightly` and the install scripts' nightly option could fail with a checksum mismatch, or silently install an old build. dl.gitea.com serves `gitea-cli/main/` like a released version, with `cache-control: public, max-age=31536000, immutable`, but each nightly overwrites those files, and each file then leaves the cache on its own. `gitea-cli-main-linux-amd64.xz` was still a build from Nov 2 while its `.sha256` was from Nov 5.
Directories with `nightly` in their name, such as `gitea/main-nightly` and `gitea-runner/nightly`, get `max-age=300, must-revalidate`, so nightlies now go to `gitea-cli/main-nightly`, named like Gitea's.
The v1.0.0 and v1.1.0 binaries still look in `main`, so their `gt upgrade --nightly` stays on the last build there until they upgrade to a release with this change. The CDN's rule isn't in this repository: the headers of the first nightly after this merge will confirm it applies.
Reviewed-on: https://gitea.com/gitea/cli/pulls/102
Reviewed-by: techknowlogick <[email protected]>
gt ships Windows builds, but CI only runs the tests on Linux; Windows is only vetted.
gitea.com has no Windows runners, so a new weekly and on-demand workflow installs Windows Server 2025 Core in a [dockur/windows](https://github.com/dockur/windows) QEMU VM and runs the cross-compiled unit test binaries there, the way https://gitea.com/gitea/runner/pulls/1348 does for the runner. Without `/dev/kvm` on the hosts, Windows is emulated and a run takes about two hours.
The first runs also found Windows bugs, fixed here: replacing a settings or credential file that another reader holds open failed, and `gt upgrade` left the old executable behind.
Reviewed-on: https://gitea.com/gitea/cli/pulls/64
gt builds for OpenBSD on amd64 and arm64 unchanged, but releases did not include them. Releases now ship both, and install.sh falls back to the ftp and sha256 tools of base OpenBSD, which has neither curl nor wget. CI vets every release system so a break outside Linux shows up in pull requests.
Refs https://gitea.com/gitea/tea/issues/436
Reviewed-on: https://gitea.com/gitea/cli/pulls/32
Fixes the problems found in repeated reviews and end-to-end runs against Gitea 28.2 before tagging v0.1.0. Each fix comes with a regression test.
- Requests: http_timeout only bounds waiting (uploads and slow downloads aren't cut off, stalls fail), safe retries, redirects to object storage, secrets kept out of `--debug`/`--verbose`, `--paginate` without Link headers
- Pull requests: fork pushes, review comments on the exact diff line, pending reviews, `pr edit` reports what Gitea leaves out
- Issues and more: metadata Gitea drops is reported, missing repository vs. missing item named, deadlines as end of day
- Actions and releases: watch loops survive short outages, exact asset names
- Terminal: color settings, escape sanitizing, accessible forms (TERM=dumb), Windows console
- Build: Go 1.27.3, Docker entrypoint, install script, Makefile
Reviewed-on: https://gitea.com/gitea/cli/pulls/7
The CLI becomes gitea-cli, invoked as gt.
- module path gitea.dev/cli, repository gitea.com/gitea/cli
- the binary, completions and man pages are named gt
- environment variables use the GITEA_CLI_ prefix
- the configuration directory, keyring service and git config keys use
gitea-cli
- release archives, the Docker image and the snap are named gitea-cli
- version builds only from v* tags
- remove the 1.0 migration guide
Signed-off-by: bircni <[email protected]>
- **switch tea to the Cobra command tree:** `internal/app` wires the packages from parts 1–4 into explicit noun/verb commands with `--repo`, `--json` / `--jq`, `--sudo` and `--debug`; `main.go` points at it. Build, release and docs tooling (`tools/cli-docs`, Makefile, goreleaser, snap, CI) and README / CONTRIBUTING are updated.
- **remove the urfave/cli command tree:** deletes `cmd/`, `modules/`, the old integration tests, contrib completion scripts and the generated `docs/CLI.md`, and drops their dependencies. This commit only deletes.
## Breaking changes
This is a breaking release. It requires Gitea 28 or newer; configuration moves to separate `config.yml` and `hosts.yml` files and requires fresh authentication, and command names, aliases, flags and output formats change. `docs/migration-1.0.md` maps every old command, flag and environment variable to its replacement.
## Issues
fixes#1118fixes#1116fixes#1115fixes#1094fixes#1091fixes#1073fixes#1052fixes#1032fixes#1023fixes#966fixes#908fixes#833fixes#831fixes#817fixes#804fixes#779fixes#770fixes#737fixes#697fixes#726fixes#677fixes#672fixes#633fixes#632fixes#560fixes#556fixes#523fixes#516fixes#510fixes#504fixes#500fixes#482fixes#406fixes#403fixes#373fixes#351fixes#344fixes#326fixes#325fixes#323fixes#246fixes#240fixes#232fixes#197fixes#172fixes#141fixes#69fixes#1110fixes#569fixes#480fixes#666fixes#670fixes#457fixes#643fixes#498fixes#490fixes#1069fixes#834fixes#602fixes#328fixes#417fixes#571fixes#1029fixes#489fixes#1050fixes#162fixes#430fixes#1087fixes#683
Reviewed-on: https://gitea.com/gitea/tea/pulls/1126
Reviewed-by: TheFox0x7 <[email protected]>
The release pipeline uploaded artifacts to both AWS S3 (goreleaser `blobs:`) and Cloudflare R2 (custom publisher) during the migration period. The migration is done, so this removes the S3 half:
- drop the `blobs:` block from `.goreleaser.yaml`
- drop the `AWS_*` / `S3_*` env from the nightly and tag release workflows
- update the comments in `.goreleaser.yaml` and `scripts/upload-r2.sh` accordingly
Cloudflare R2 upload (including the early `--check-config` preflight step) is unchanged, and the `AWS_*` repo secrets are no longer used.
Reviewed-on: https://gitea.com/gitea/tea/pulls/1092
Reviewed-by: bircni <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
Ports the Cloudflare R2 release mirror from [gitea.com/gitea/runner](https://gitea.com/gitea/runner) to `tea`, so release artifacts land in R2 alongside S3 for the duration of the migration away from S3.
Two commits, meant to be reviewed in order.
## 1. `ci(goreleaser): migrate release config to goreleaser v2`
A purely mechanical migration, no behaviour change intended:
- add `version: 2`
- `blobs.folder` -> `blobs.directory`
- `snapshot.name_template` -> `snapshot.version_template`
- `nightly.name_template` -> `nightly.version_template`
- `version: "~> v1"` -> `"~> v2"` in both release workflows
This is a prefactor rather than scope creep. Under goreleaser v1 the custom-publisher pipe runs *4th*, before the `release` pipe; under v2 it runs *last*. That ordering difference matters for the change below: on v1 a failed R2 upload would abort the publish after every artifact had already gone to S3 but **before** the Gitea release was created, leaving a half-finished release. On v2 the R2 mirror runs after the release exists, which matches the behaviour the runner repo already has in production.
The pre-existing `archives.format` deprecation warning is deliberately left alone; it is orthogonal to this change and the runner repo has not addressed it either.
## 2. `ci(goreleaser): mirror release artifacts to Cloudflare R2`
- **`scripts/upload-r2.sh`** — uploads one local file to one R2 object key using curl's built-in AWS SigV4 signer (R2 is S3-API compatible). Credentials are fed through `curl --config -` so they never appear in `ps` output. Also provides a `--check-config` preflight mode. This file is byte-identical to the runner repo's copy.
- **`.goreleaser.yaml`** — a `publishers:` entry mirroring the existing S3 `blobs:` upload into R2. A second `blobs:` entry is not usable here: the blob pipe authenticates from the global `AWS_*` environment and has no per-entry credentials, whereas `publishers:` supports per-entry `env:`.
- **Both release workflows** — forward the R2 secrets, plus an early `check R2 configuration` step. Custom publishers run as the very last step of goreleaser's publish pipeline, so without a preflight a missing secret would only surface after the release had been created and every artifact already uploaded to S3.
### Deviation from the runner implementation
The publisher here also sets `signature: true` in addition to `checksum: true`. `tea` has a `signs:` block that GPG-signs the checksum file, and the S3 blob pipe uploads the resulting `checksums.txt.sig`; without `signature: true` the R2 mirror would carry the artifacts and their checksums but no signature to verify them against.
The object key prefix is `tea/{{ .Version }}/...`, matching the existing S3 `directory: "tea/{{.Version}}"`.
## Required repository secrets
This PR is inert until these are configured. The preflight step will fail the release loudly if they are missing:
- `R2_ENDPOINT` — e.g. `https://<account>.r2.cloudflarestorage.com`
- `R2_BUCKET`
- `R2_ACCESS_KEY_ID`
- `R2_SECRET_ACCESS_KEY`
## Verification
- `goreleaser check` against the migrated config (with the pro-only `nightly:` block temporarily stripped, since the check ran with the OSS v2 binary): *configuration is valid*, the only deprecation being the pre-existing `archives.format`.
- A real `goreleaser build --snapshot --clean --single-target` against the v2 config: succeeded, including the `xz` and `.goreleaser.checksum.sh` post-hooks.
- `scripts/upload-r2.sh`: clean under `sh -n` and `shellcheck`; all four `--check-config` cases exercised (all vars unset, one missing, all set, wrong argument count).
- The actual upload path was not exercised end to end, since that needs live R2 credentials.
Reviewed-on: https://gitea.com/gitea/tea/pulls/1063
Reviewed-by: Zettat123 <[email protected]>