1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/www/docs/scm/gitea.md
Steve Azzopardi 68ff8e996f
feat: support templates for scm urls (#2465)
Background
---
When a git repository is hosted in multiple GitLab instances the
`.goreleaser.yml` needs to take in consideration both APIs endpoints. At
the moment it defaults to GitLab.com and you can override it with
`gitlab_urls` however this forces you to only support 1 GitLab instance.

We need this for
https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/14122
where we have a tool that is developed on GitLab.com but then mirrored
to an internal GitLab instance since we need it to operate GitLab.com
even when it's down.

Solution
---
Support templates like `{{ .Env.CI_SERVER_URL }}` for the
`gitlab_urls`, `github_urls`  and `gitea_urls` so it can use environment
variables and the same `.goreleaser` file can be used in multiple SCM
instances.

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2021-09-09 01:42:13 +00:00

894 B

Gitea

API Token

GoReleaser requires an API token to deploy the artifacts to Gitea. You can create one in Settings | Applications | Generate New Token page of your Gitea instance.

This token should be added to the environment variables as GITEA_TOKEN.

Alternatively, you can provide the Gitea token in a file. GoReleaser will check ~/.config/goreleaser/gitea_token by default, but you can change that in the .goreleaser.yml file:

# .goreleaser.yml
env_files:
  gitea_token: ~/.path/to/my/gitea_token

URLs

You can use GoReleaser with Gitea by providing its URLs in the .goreleaser.yml configuration file. This takes a normal string or a template value.

# .goreleaser.yml
gitea_urls:
  api: https://gitea.myinstance.com/api/v1/
  download: https://gitea.myinstance.com
  # set to true if you use a self-signed certificate
  skip_tls_verify: false