mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-11 14:39:28 +02:00
docs: fix templated contents
This commit is contained in:
parent
b9b3865108
commit
b786c0283a
@ -9,7 +9,7 @@ Here is a commented `archives` section with all fields specified:
|
||||
```yaml
|
||||
# .goreleaser.yaml
|
||||
archives:
|
||||
-
|
||||
- #
|
||||
# ID of this archive.
|
||||
#
|
||||
# Default: 'default'
|
||||
@ -17,7 +17,7 @@ archives:
|
||||
|
||||
# Builds reference which build instances should be archived in this archive.
|
||||
builds:
|
||||
- default
|
||||
- default
|
||||
|
||||
# Archive format. Valid options are `tar.gz`, `tgz`, `tar.xz`, `txz`, tar`, `gz`, `zip` and `binary`.
|
||||
# If format is `binary`, no archives are created and the binaries are instead
|
||||
@ -54,7 +54,6 @@ archives:
|
||||
# format is `time.RFC3339Nano`
|
||||
mtime: 2008-01-02T15:04:05Z
|
||||
|
||||
|
||||
# Set this to true if you want all files in the archive to be in a single directory.
|
||||
# If set to true and you extract the archive 'goreleaser_Linux_arm64.tar.gz',
|
||||
# you'll get a folder 'goreleaser_Linux_arm64'.
|
||||
@ -69,7 +68,6 @@ archives:
|
||||
# Since: v1.11
|
||||
strip_parent_binary_folder: true
|
||||
|
||||
|
||||
# This will make the destination paths be relative to the longest common
|
||||
# path prefix between all the files matched and the source glob.
|
||||
# Enabling this essentially mimic the behavior of nfpm's contents section.
|
||||
@ -96,7 +94,7 @@ archives:
|
||||
- design/*.png
|
||||
- templates/**/*
|
||||
# a more complete example, check the globbing deep dive below
|
||||
- src: '*.md'
|
||||
- src: "*.md"
|
||||
dst: docs
|
||||
|
||||
# Strip parent folders when adding files to the archive.
|
||||
@ -116,12 +114,11 @@ archives:
|
||||
# Must be in time.RFC3339Nano format.
|
||||
#
|
||||
# Templates: allowed (since v1.14)
|
||||
mtime: '{{ .CommitDate }}'
|
||||
mtime: "{{ .CommitDate }}"
|
||||
|
||||
# File mode.
|
||||
mode: 0644
|
||||
|
||||
|
||||
# Additional templated files to add to the archive.
|
||||
# Those files will have their contents pass through the template engine,
|
||||
# and its results will be added to the archive.
|
||||
@ -129,9 +126,9 @@ archives:
|
||||
# Since: v1.17 (pro)
|
||||
# This feature is only available in GoReleaser Pro.
|
||||
# Templates: allowed
|
||||
files:
|
||||
templated_files:
|
||||
# a more complete example, check the globbing deep dive below
|
||||
- src: 'LICENSE.md.tpl'
|
||||
- src: "LICENSE.md.tpl"
|
||||
dst: LICENSE.md
|
||||
|
||||
# File info.
|
||||
@ -147,7 +144,7 @@ archives:
|
||||
|
||||
# Must be in time.RFC3339Nano format.
|
||||
# Templateable (since v1.14.0)
|
||||
mtime: '{{ .CommitDate }}'
|
||||
mtime: "{{ .CommitDate }}"
|
||||
|
||||
# File mode.
|
||||
mode: 0644
|
||||
@ -157,41 +154,46 @@ archives:
|
||||
# This feature is only available in GoReleaser Pro.
|
||||
hooks:
|
||||
before:
|
||||
- make clean # simple string
|
||||
- cmd: go generate ./... # specify cmd
|
||||
- cmd: go mod tidy
|
||||
output: true # always prints command output
|
||||
dir: ./submodule # specify command working directory
|
||||
- cmd: touch {{ .Env.FILE_TO_TOUCH }}
|
||||
env:
|
||||
- 'FILE_TO_TOUCH=something-{{ .ProjectName }}' # specify hook level environment variables
|
||||
- make clean # simple string
|
||||
- cmd: go generate ./... # specify cmd
|
||||
- cmd: go mod tidy
|
||||
output: true # always prints command output
|
||||
dir: ./submodule # specify command working directory
|
||||
- cmd: touch {{ .Env.FILE_TO_TOUCH }}
|
||||
env:
|
||||
- "FILE_TO_TOUCH=something-{{ .ProjectName }}" # specify hook level environment variables
|
||||
|
||||
after:
|
||||
- make clean
|
||||
- cmd: cat *.yaml
|
||||
dir: ./submodule
|
||||
- cmd: touch {{ .Env.RELEASE_DONE }}
|
||||
env:
|
||||
- 'RELEASE_DONE=something-{{ .ProjectName }}' # specify hook level environment variables
|
||||
- make clean
|
||||
- cmd: cat *.yaml
|
||||
dir: ./submodule
|
||||
- cmd: touch {{ .Env.RELEASE_DONE }}
|
||||
env:
|
||||
- "RELEASE_DONE=something-{{ .ProjectName }}" # specify hook level environment variables
|
||||
|
||||
# Disables the binary count check.
|
||||
allow_different_binary_count: true
|
||||
```
|
||||
|
||||
!!! success "GoReleaser Pro"
|
||||
|
||||
Archive hooks is a [GoReleaser Pro feature](/pro/).
|
||||
|
||||
!!! tip
|
||||
|
||||
Learn more about the [name template engine](/customization/templates/).
|
||||
|
||||
!!! tip
|
||||
|
||||
You can add entire folders, its subfolders and files by using the glob notation,
|
||||
for example: `myfolder/**/*`.
|
||||
|
||||
!!! warning
|
||||
|
||||
The `files` and `wrap_in_directory` options are ignored if `format` is `binary`.
|
||||
|
||||
!!! warning
|
||||
|
||||
The `name_template` option will not reflect the filenames under the `dist` folder if `format` is `binary`.
|
||||
The template will be applied only where the binaries are uploaded (e.g. GitHub releases).
|
||||
|
||||
@ -202,30 +204,29 @@ We'll walk through what happens in each case using some examples.
|
||||
```yaml
|
||||
# ...
|
||||
files:
|
||||
# Adds `README.md` at the root of the archive:
|
||||
- README.md
|
||||
|
||||
# Adds `README.md` at the root of the archive:
|
||||
- README.md
|
||||
# Adds all `md` files to the root of the archive:
|
||||
- "*.md"
|
||||
|
||||
# Adds all `md` files to the root of the archive:
|
||||
- '*.md'
|
||||
# Adds all `md` files to the root of the archive:
|
||||
- src: "*.md"
|
||||
|
||||
# Adds all `md` files to the root of the archive:
|
||||
- src: '*.md'
|
||||
# Adds all `md` files in the current folder to a `docs` folder in the archive:
|
||||
- src: "*.md"
|
||||
dst: docs
|
||||
|
||||
# Adds all `md` files in the current folder to a `docs` folder in the archive:
|
||||
- src: '*.md'
|
||||
dst: docs
|
||||
# Recursively adds all `go` files to a `source` folder in the archive.
|
||||
# in this case, `cmd/myapp/main.go` will be added as `source/cmd/myapp/main.go`
|
||||
- src: "**/*.go"
|
||||
dst: source
|
||||
|
||||
# Recursively adds all `go` files to a `source` folder in the archive.
|
||||
# in this case, `cmd/myapp/main.go` will be added as `source/cmd/myapp/main.go`
|
||||
- src: '**/*.go'
|
||||
dst: source
|
||||
|
||||
# Recursively adds all `go` files to a `source` folder in the archive, stripping their parent folder.
|
||||
# In this case, `cmd/myapp/main.go` will be added as `source/main.go`:
|
||||
- src: '**/*.go'
|
||||
dst: source
|
||||
strip_parent: true
|
||||
# Recursively adds all `go` files to a `source` folder in the archive, stripping their parent folder.
|
||||
# In this case, `cmd/myapp/main.go` will be added as `source/main.go`:
|
||||
- src: "**/*.go"
|
||||
dst: source
|
||||
strip_parent: true
|
||||
# ...
|
||||
```
|
||||
|
||||
@ -240,8 +241,8 @@ A working hack is to use something like this:
|
||||
```yaml
|
||||
# .goreleaser.yaml
|
||||
archives:
|
||||
- files:
|
||||
- none*
|
||||
- files:
|
||||
- none*
|
||||
```
|
||||
|
||||
This would add all files matching the glob `none*`, provide that you don't
|
||||
@ -261,15 +262,16 @@ will probably look like this:
|
||||
```yaml
|
||||
# .goreleaser.yaml
|
||||
archives:
|
||||
- format: gz
|
||||
files:
|
||||
- none*
|
||||
- format: gz
|
||||
files:
|
||||
- none*
|
||||
```
|
||||
|
||||
This should create `.gz` files with the binaries only, which should be
|
||||
extracted with something like `gzip -d file.gz`.
|
||||
|
||||
!!! warning
|
||||
|
||||
You won't be able to package multiple builds in a single archive either.
|
||||
The alternative is to declare multiple archives filtering by build ID.
|
||||
|
||||
@ -280,7 +282,7 @@ You can do that by setting `format` to `binary`:
|
||||
```yaml
|
||||
# .goreleaser.yaml
|
||||
archives:
|
||||
- format: binary
|
||||
- format: binary
|
||||
```
|
||||
|
||||
Make sure to check the rest of the documentation above, as doing this has some
|
||||
|
@ -9,8 +9,7 @@ Google GCS.
|
||||
# .goreleaser.yaml
|
||||
blobs:
|
||||
# You can have multiple blob configs
|
||||
-
|
||||
# Cloud provider name:
|
||||
- # Cloud provider name:
|
||||
# - s3 for AWS S3 Storage
|
||||
# - azblob for Azure Blob Storage
|
||||
# - gs for Google Cloud Storage
|
||||
@ -43,8 +42,8 @@ blobs:
|
||||
|
||||
# IDs of the artifacts you want to upload.
|
||||
ids:
|
||||
- foo
|
||||
- bar
|
||||
- foo
|
||||
- bar
|
||||
|
||||
# Path/name inside the bucket.
|
||||
#
|
||||
@ -70,7 +69,6 @@ blobs:
|
||||
# Templates: allowed
|
||||
name_template: file.txt # note that this only works if glob matches 1 file only
|
||||
|
||||
|
||||
# Additional templated extra files to uploaded.
|
||||
# Those files will have their contents pass through the template engine,
|
||||
# and its results will be uploaded.
|
||||
@ -82,17 +80,16 @@ blobs:
|
||||
- src: LICENSE.tpl
|
||||
dst: LICENSE.txt
|
||||
|
||||
-
|
||||
provider: gs
|
||||
- provider: gs
|
||||
bucket: goreleaser-bucket
|
||||
folder: "foo/bar/{{.Version}}"
|
||||
-
|
||||
provider: s3
|
||||
- provider: s3
|
||||
bucket: goreleaser-bucket
|
||||
folder: "foo/bar/{{.Version}}"
|
||||
```
|
||||
|
||||
!!! tip
|
||||
|
||||
Learn more about the [name template engine](/customization/templates/).
|
||||
|
||||
## Authentication
|
||||
@ -125,7 +122,7 @@ in the following order:
|
||||
|
||||
- Environment Variable (`GOOGLE_APPLICATION_CREDENTIALS`)
|
||||
- Default Service Account from the compute instance (Compute Engine,
|
||||
Kubernetes Engine, Cloud function etc).
|
||||
Kubernetes Engine, Cloud function etc).
|
||||
|
||||
## ACLs
|
||||
|
||||
|
@ -43,7 +43,6 @@ checksum:
|
||||
- glob: ./single_file.txt
|
||||
name_template: file.txt # note that this only works if glob matches 1 file only
|
||||
|
||||
|
||||
# Additional templated extra files to add to the checksum.
|
||||
# Those files will have their contents pass through the template engine,
|
||||
# and its results will be added to the checksum.
|
||||
@ -54,8 +53,8 @@ checksum:
|
||||
templated_extra_files:
|
||||
- src: LICENSE.tpl
|
||||
dst: LICENSE.txt
|
||||
|
||||
```
|
||||
|
||||
!!! tip
|
||||
|
||||
Learn more about the [name template engine](/customization/templates/).
|
||||
|
@ -16,10 +16,11 @@ name of your image to your `.goreleaser.yaml` file:
|
||||
```yaml
|
||||
dockers:
|
||||
- image_templates:
|
||||
- user/repo
|
||||
- user/repo
|
||||
```
|
||||
|
||||
!!! tip
|
||||
|
||||
The `image_templates` attribute supports templating. Learn more about the [name template engine](/customization/templates/).
|
||||
|
||||
You also need to create a `Dockerfile` in your project's root folder:
|
||||
@ -33,6 +34,7 @@ COPY mybin /
|
||||
This configuration will build and push a Docker image named `user/repo:tagname`.
|
||||
|
||||
!!! warning
|
||||
|
||||
Note that we are not building any go files in the Docker
|
||||
build phase, we are merely copying the binary to a `scratch` image and
|
||||
setting up the `entrypoint`.
|
||||
@ -45,7 +47,7 @@ Of course, you can customize a lot of things:
|
||||
# .goreleaser.yaml
|
||||
dockers:
|
||||
# You can have multiple Docker images.
|
||||
-
|
||||
- #
|
||||
# ID of the image, needed if you want to filter by it later on (e.g. on custom publishers).
|
||||
id: myimg
|
||||
|
||||
@ -59,27 +61,26 @@ dockers:
|
||||
|
||||
# GOARM of the built binaries/packages that should be used.
|
||||
# Default: '6'
|
||||
goarm: ''
|
||||
goarm: ""
|
||||
|
||||
# GOAMD64 of the built binaries/packages that should be used.
|
||||
# Default: 'v1'
|
||||
goamd64: 'v2'
|
||||
goamd64: "v2"
|
||||
|
||||
# IDs to filter the binaries/packages.
|
||||
ids:
|
||||
- mybuild
|
||||
- mynfpm
|
||||
- mybuild
|
||||
- mynfpm
|
||||
|
||||
# Templates of the Docker image names.
|
||||
#
|
||||
# Templates: allowed
|
||||
image_templates:
|
||||
- "myuser/myimage:latest"
|
||||
- "myuser/myimage:{{ .Tag }}"
|
||||
- "myuser/myimage:{{ .Tag }}-{{ .Env.FOOBAR }}"
|
||||
- "myuser/myimage:v{{ .Major }}"
|
||||
- "gcr.io/myuser/myimage:latest"
|
||||
|
||||
- "myuser/myimage:latest"
|
||||
- "myuser/myimage:{{ .Tag }}"
|
||||
- "myuser/myimage:{{ .Tag }}-{{ .Env.FOOBAR }}"
|
||||
- "myuser/myimage:v{{ .Major }}"
|
||||
- "gcr.io/myuser/myimage:latest"
|
||||
|
||||
# Skips the docker build.
|
||||
# Could be useful if you want to skip building the windows docker image on
|
||||
@ -102,7 +103,7 @@ dockers:
|
||||
# Path to the Dockerfile (from the project root).
|
||||
#
|
||||
# Default: 'Dockerfile'
|
||||
dockerfile: '{{ .Env.DOCKERFILE }}'
|
||||
dockerfile: "{{ .Env.DOCKERFILE }}"
|
||||
|
||||
# Set the "backend" for the Docker pipe.
|
||||
#
|
||||
@ -117,17 +118,17 @@ dockers:
|
||||
#
|
||||
# Templates: allowed
|
||||
build_flag_templates:
|
||||
- "--pull"
|
||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
||||
- "--label=org.opencontainers.image.title={{.ProjectName}}"
|
||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
||||
- "--label=org.opencontainers.image.version={{.Version}}"
|
||||
- "--build-arg=FOO={{.Env.Bar}}"
|
||||
- "--platform=linux/arm64"
|
||||
- "--pull"
|
||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
||||
- "--label=org.opencontainers.image.title={{.ProjectName}}"
|
||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
||||
- "--label=org.opencontainers.image.version={{.Version}}"
|
||||
- "--build-arg=FOO={{.Env.Bar}}"
|
||||
- "--platform=linux/arm64"
|
||||
|
||||
# Extra flags to be passed down to the push command.
|
||||
push_flags:
|
||||
- --tls-verify=false
|
||||
- --tls-verify=false
|
||||
|
||||
# If your Dockerfile copies files other than binaries and packages,
|
||||
# you should list them here as well.
|
||||
@ -139,8 +140,7 @@ dockers:
|
||||
# This field does not support wildcards, you can add an entire folder here
|
||||
# and use wildcards when you `COPY`/`ADD` in your Dockerfile.
|
||||
extra_files:
|
||||
- config.yml
|
||||
|
||||
- config.yml
|
||||
|
||||
# Additional templated extra files to add to the Docker image.
|
||||
# Those files will have their contents pass through the template engine,
|
||||
@ -154,17 +154,19 @@ dockers:
|
||||
- src: LICENSE.tpl
|
||||
dst: LICENSE.txt
|
||||
mode: 0644
|
||||
|
||||
```
|
||||
|
||||
!!! warning
|
||||
|
||||
Note that you will have to manually login into the Docker registries you
|
||||
want to push to — GoReleaser does not login by itself.
|
||||
|
||||
!!! tip
|
||||
|
||||
Learn more about the [name template engine](/customization/templates/).
|
||||
|
||||
!!! tip
|
||||
|
||||
You can also create multi-platform images using the [docker_manifests](/customization/docker_manifest/) config.
|
||||
|
||||
These settings should allow you to generate multiple Docker images,
|
||||
@ -181,9 +183,8 @@ That can be accomplished simply by adding template language in the definition:
|
||||
# .goreleaser.yaml
|
||||
project_name: foo
|
||||
dockers:
|
||||
-
|
||||
image_templates:
|
||||
- "myuser/{{.ProjectName}}"
|
||||
- image_templates:
|
||||
- "myuser/{{.ProjectName}}"
|
||||
```
|
||||
|
||||
This will build and publish the following images:
|
||||
@ -191,7 +192,7 @@ This will build and publish the following images:
|
||||
- `myuser/foo`
|
||||
|
||||
!!! tip
|
||||
Learn more about the [name template engine](/customization/templates/).
|
||||
Learn more about the [name template engine](/customization/templates/).
|
||||
|
||||
## Keeping docker images updated for current major
|
||||
|
||||
@ -202,12 +203,11 @@ accomplished by using multiple `image_templates`:
|
||||
```yaml
|
||||
# .goreleaser.yaml
|
||||
dockers:
|
||||
-
|
||||
image_templates:
|
||||
- "myuser/myimage:{{ .Tag }}"
|
||||
- "myuser/myimage:v{{ .Major }}"
|
||||
- "myuser/myimage:v{{ .Major }}.{{ .Minor }}"
|
||||
- "myuser/myimage:latest"
|
||||
- image_templates:
|
||||
- "myuser/myimage:{{ .Tag }}"
|
||||
- "myuser/myimage:v{{ .Major }}"
|
||||
- "myuser/myimage:v{{ .Major }}.{{ .Minor }}"
|
||||
- "myuser/myimage:latest"
|
||||
```
|
||||
|
||||
This will build and publish the following images:
|
||||
@ -221,6 +221,7 @@ With these settings you can hopefully push several Docker images
|
||||
with multiple tags.
|
||||
|
||||
!!! tip
|
||||
|
||||
Learn more about the [name template engine](/customization/templates/).
|
||||
|
||||
## Publishing to multiple docker registries
|
||||
@ -231,12 +232,11 @@ accomplished by using multiple `image_templates`:
|
||||
```yaml
|
||||
# .goreleaser.yaml
|
||||
dockers:
|
||||
-
|
||||
image_templates:
|
||||
- "docker.io/myuser/myimage:{{ .Tag }}"
|
||||
- "docker.io/myuser/myimage:latest"
|
||||
- "gcr.io/myuser/myimage:{{ .Tag }}"
|
||||
- "gcr.io/myuser/myimage:latest"
|
||||
- image_templates:
|
||||
- "docker.io/myuser/myimage:{{ .Tag }}"
|
||||
- "docker.io/myuser/myimage:latest"
|
||||
- "gcr.io/myuser/myimage:{{ .Tag }}"
|
||||
- "gcr.io/myuser/myimage:latest"
|
||||
```
|
||||
|
||||
This will build and publish the following images to `docker.io` and `gcr.io`:
|
||||
@ -254,15 +254,14 @@ The flags must be valid Docker build flags.
|
||||
```yaml
|
||||
# .goreleaser.yaml
|
||||
dockers:
|
||||
-
|
||||
image_templates:
|
||||
- "myuser/myimage"
|
||||
- image_templates:
|
||||
- "myuser/myimage"
|
||||
build_flag_templates:
|
||||
- "--pull"
|
||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
||||
- "--label=org.opencontainers.image.title={{.ProjectName}}"
|
||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
||||
- "--label=org.opencontainers.image.version={{.Version}}"
|
||||
- "--pull"
|
||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
||||
- "--label=org.opencontainers.image.title={{.ProjectName}}"
|
||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
||||
- "--label=org.opencontainers.image.version={{.Version}}"
|
||||
```
|
||||
|
||||
This will execute the following command:
|
||||
@ -277,6 +276,7 @@ docker build -t myuser/myimage . \
|
||||
```
|
||||
|
||||
!!! tip
|
||||
|
||||
Learn more about the [name template engine](/customization/templates/).
|
||||
|
||||
## Use a specific builder with Docker buildx
|
||||
@ -289,20 +289,21 @@ the `build_flag_templates` field:
|
||||
```yaml
|
||||
# .goreleaser.yaml
|
||||
dockers:
|
||||
-
|
||||
image_templates:
|
||||
- "myuser/myimage"
|
||||
- image_templates:
|
||||
- "myuser/myimage"
|
||||
use: buildx
|
||||
build_flag_templates:
|
||||
- "--builder=mybuilder"
|
||||
- "--builder=mybuilder"
|
||||
```
|
||||
|
||||
!!! tip
|
||||
|
||||
Learn more about the [buildx builder instances](https://docs.docker.com/buildx/working-with-buildx/#work-with-builder-instances).
|
||||
|
||||
## Podman
|
||||
|
||||
!!! success "GoReleaser Pro"
|
||||
|
||||
The podman backend is a [GoReleaser Pro feature](/pro/).
|
||||
|
||||
You can use [`podman`](https://podman.io) instead of `docker` by setting `use` to `podman` on your config:
|
||||
@ -310,9 +311,8 @@ You can use [`podman`](https://podman.io) instead of `docker` by setting `use` t
|
||||
```yaml
|
||||
# .goreleaser.yaml
|
||||
dockers:
|
||||
-
|
||||
image_templates:
|
||||
- "myuser/myimage"
|
||||
- image_templates:
|
||||
- "myuser/myimage"
|
||||
use: podman
|
||||
```
|
||||
|
||||
@ -321,4 +321,3 @@ configuration.
|
||||
|
||||
If you want to use it rootless, make sure to follow
|
||||
[this guide](https://github.com/containers/podman/blob/main/docs/tutorials/rootless_tutorial.md).
|
||||
|
||||
|
@ -189,7 +189,7 @@ nfpms:
|
||||
# Since: v1.17 (pro)
|
||||
# This feature is only available in GoReleaser Pro.
|
||||
# Templates: allowed
|
||||
files:
|
||||
templated_contents:
|
||||
# a more complete example, check the globbing deep dive below
|
||||
- src: "LICENSE.md.tpl"
|
||||
dst: LICENSE.md
|
||||
|
@ -40,7 +40,6 @@ Environment variables that are kept:
|
||||
- `TEMP`
|
||||
- `PATH`
|
||||
|
||||
|
||||
You can however use `.Env.NAME` templating syntax, which enables
|
||||
more explicit inheritance.
|
||||
|
||||
@ -70,14 +69,14 @@ publishers:
|
||||
- TOKEN={{ .Env.CUSTOM_PUBLISHER_TOKEN }}
|
||||
```
|
||||
|
||||
so the above example will execute:
|
||||
So the above example will execute:
|
||||
|
||||
```bash
|
||||
custom-publisher -product=goreleaser -version=1.0.0 goreleaser_1.0.0_linux_amd64.zip
|
||||
```
|
||||
in `/path/to/dist` with
|
||||
`TOKEN=token`, assuming that GoReleaser is executed with
|
||||
`CUSTOM_PUBLISHER_TOKEN=token`.
|
||||
|
||||
In `/path/to/dist` with `TOKEN=token`, assuming that GoReleaser is executed
|
||||
with `CUSTOM_PUBLISHER_TOKEN=token`.
|
||||
|
||||
Supported variables:
|
||||
|
||||
@ -97,14 +96,14 @@ Of course, you can customize a lot of things:
|
||||
```yaml
|
||||
# .goreleaser.yaml
|
||||
publishers:
|
||||
-
|
||||
- #
|
||||
# Unique name of your publisher. Used for identification
|
||||
name: "custom"
|
||||
|
||||
# IDs of the artifacts you want to publish
|
||||
ids:
|
||||
- foo
|
||||
- bar
|
||||
- foo
|
||||
- bar
|
||||
|
||||
# Publish checksums.
|
||||
checksum: true
|
||||
@ -134,7 +133,6 @@ publishers:
|
||||
- glob: ./single_file.txt
|
||||
name_template: file.txt # note that this only works if glob matches 1 file only
|
||||
|
||||
|
||||
# Additional templated extra files to published.
|
||||
# Those files will have their contents pass through the template engine,
|
||||
# and its results will be published.
|
||||
@ -145,7 +143,6 @@ publishers:
|
||||
templated_extra_files:
|
||||
- src: LICENSE.tpl
|
||||
dst: LICENSE.txt
|
||||
|
||||
```
|
||||
|
||||
These settings should allow you to push your artifacts to any number of
|
||||
@ -153,4 +150,5 @@ endpoints, which may require non-trivial authentication or has otherwise complex
|
||||
requirements.
|
||||
|
||||
!!! tip
|
||||
|
||||
Learn more about the [name template engine](/customization/templates/).
|
||||
|
@ -49,7 +49,7 @@ release:
|
||||
# Default: ''
|
||||
# Since: v1.11
|
||||
# Templates: allowed
|
||||
target_commitish: '{{ .Commit }}'
|
||||
target_commitish: "{{ .Commit }}"
|
||||
|
||||
# This allows to change which tag GitHub will create.
|
||||
# Usually you'll use this together with `target_commitish`, or if you want to
|
||||
@ -59,7 +59,7 @@ release:
|
||||
# Default: '{{ .PrefixedCurrentTag }}'
|
||||
# Since: v1.19 (pro)
|
||||
# Templates: allowed
|
||||
tag: '{{ .CurrentTag }}'
|
||||
tag: "{{ .CurrentTag }}"
|
||||
|
||||
# If set, will create a release discussion in the category specified.
|
||||
#
|
||||
@ -135,7 +135,6 @@ release:
|
||||
- glob: ./single_file.txt
|
||||
name_template: file.txt # note that this only works if glob matches 1 file only
|
||||
|
||||
|
||||
# Additional templated extra files to add to the release.
|
||||
# Those files will have their contents pass through the template engine,
|
||||
# and its results will be added to the release.
|
||||
@ -146,10 +145,10 @@ release:
|
||||
templated_extra_files:
|
||||
- src: LICENSE.tpl
|
||||
dst: LICENSE.txt
|
||||
|
||||
```
|
||||
|
||||
!!! tip
|
||||
|
||||
[Learn how to set up an API token, GitHub Enterprise, etc](/scm/github/).
|
||||
|
||||
## GitLab
|
||||
@ -206,13 +205,16 @@ release:
|
||||
```
|
||||
|
||||
!!! tip
|
||||
|
||||
[Learn how to set up an API token, self-hosted GitLab, etc](/scm/gitlab/).
|
||||
|
||||
!!! tip
|
||||
|
||||
If you use GitLab subgroups, you need to specify it in the `owner` field,
|
||||
e.g. `mygroup/mysubgroup`.
|
||||
|
||||
!!! warning
|
||||
|
||||
Only GitLab `v12.9+` is supported for releases.
|
||||
|
||||
## Gitea
|
||||
@ -273,17 +275,21 @@ ALLOWED_TYPES = application/gzip|application/x-gzip|application/x-gtar|applicati
|
||||
```
|
||||
|
||||
!!! tip
|
||||
|
||||
[Learn how to set up an API token](/scm/gitea/).
|
||||
|
||||
!!! tip
|
||||
|
||||
Learn more about the [name template engine](/customization/templates/).
|
||||
|
||||
!!! warning
|
||||
|
||||
Gitea versions earlier than 1.9.2 do not support uploading `checksums.txt`
|
||||
files because of a [bug](https://github.com/go-gitea/gitea/issues/7882),
|
||||
so you will have to enable all file types with `*/*`.
|
||||
|
||||
!!! warning
|
||||
|
||||
`draft` and `prerelease` are only supported by GitHub and Gitea.
|
||||
|
||||
### Define Previous Tag
|
||||
@ -318,6 +324,7 @@ Some changelog generators you can use:
|
||||
- [miniscruff/changie](https://github.com/miniscruff/changie)
|
||||
|
||||
!!! info
|
||||
|
||||
If you create the release before running GoReleaser, and the said release
|
||||
has some text in its body, GoReleaser will not override it with its release
|
||||
notes.
|
||||
|
@ -13,20 +13,20 @@ source:
|
||||
#
|
||||
# Default: '{{ .ProjectName }}-{{ .Version }}'
|
||||
# Templates: allowed
|
||||
name_template: '{{ .ProjectName }}'
|
||||
name_template: "{{ .ProjectName }}"
|
||||
|
||||
# Format of the archive.
|
||||
#
|
||||
# Valid formats are: tar, tgz, tar.gz, and zip.
|
||||
#
|
||||
# Default: 'tar.gz'
|
||||
format: 'tar'
|
||||
format: "tar"
|
||||
|
||||
# Prefix.
|
||||
# String to prepend to each filename in the archive.
|
||||
#
|
||||
# Templates: allowed
|
||||
prefix_template: '{{ .ProjectName }}-{{ .Version }}/'
|
||||
prefix_template: "{{ .ProjectName }}-{{ .Version }}/"
|
||||
|
||||
# This will make the destination paths be relative to the longest common
|
||||
# path prefix between all the files matched and the source glob.
|
||||
@ -48,7 +48,7 @@ source:
|
||||
- design/*.png
|
||||
- templates/**/*
|
||||
# a more complete example, check the globbing deep dive below
|
||||
- src: '*.md'
|
||||
- src: "*.md"
|
||||
dst: docs
|
||||
|
||||
# Strip parent folders when adding files to the archive.
|
||||
@ -64,7 +64,6 @@ source:
|
||||
# format is `time.RFC3339Nano`
|
||||
mtime: 2008-01-02T15:04:05Z
|
||||
|
||||
|
||||
# Additional templated files to add to the source archive.
|
||||
# Those files will have their contents pass through the template engine,
|
||||
# and its results will be added to the source archive.
|
||||
@ -72,17 +71,17 @@ source:
|
||||
# Since: v1.17 (pro)
|
||||
# This feature is only available in GoReleaser Pro.
|
||||
# Templates: allowed
|
||||
files:
|
||||
templated_files:
|
||||
# a more complete example, check the globbing deep dive below
|
||||
- src: 'LICENSE.md.tpl'
|
||||
- src: "LICENSE.md.tpl"
|
||||
dst: LICENSE.md
|
||||
info:
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
mtime: 2008-01-02T15:04:05Z
|
||||
|
||||
```
|
||||
|
||||
!!! tip
|
||||
|
||||
Learn more about the [name template engine](/customization/templates/).
|
||||
|
36
www/docs/static/schema-pro.json
generated
vendored
36
www/docs/static/schema-pro.json
generated
vendored
@ -226,8 +226,7 @@
|
||||
"type": "boolean"
|
||||
}
|
||||
],
|
||||
"description": "you can now remove this",
|
||||
"deprecated": true
|
||||
"description": "you can now remove this"
|
||||
},
|
||||
"files": {
|
||||
"items": {
|
||||
@ -1246,8 +1245,7 @@
|
||||
},
|
||||
"tap": {
|
||||
"$ref": "#/$defs/RepoRef",
|
||||
"description": "use repository instead",
|
||||
"deprecated": true
|
||||
"description": "use repository instead"
|
||||
},
|
||||
"repository": {
|
||||
"$ref": "#/$defs/RepoRef"
|
||||
@ -1266,8 +1264,7 @@
|
||||
},
|
||||
"plist": {
|
||||
"type": "string",
|
||||
"description": "use service instead",
|
||||
"deprecated": true
|
||||
"description": "use service instead"
|
||||
},
|
||||
"install": {
|
||||
"type": "string"
|
||||
@ -1566,8 +1563,7 @@
|
||||
},
|
||||
"index": {
|
||||
"$ref": "#/$defs/RepoRef",
|
||||
"description": "use repository instead",
|
||||
"deprecated": true
|
||||
"description": "use repository instead"
|
||||
},
|
||||
"repository": {
|
||||
"$ref": "#/$defs/RepoRef"
|
||||
@ -2322,8 +2318,7 @@
|
||||
},
|
||||
"scoop": {
|
||||
"$ref": "#/$defs/Scoop",
|
||||
"description": "use scoops insteads",
|
||||
"deprecated": true
|
||||
"description": "use scoops insteads"
|
||||
},
|
||||
"scoops": {
|
||||
"items": {
|
||||
@ -2471,8 +2466,7 @@
|
||||
},
|
||||
"build": {
|
||||
"$ref": "#/$defs/Build",
|
||||
"description": "use builds instead",
|
||||
"deprecated": true
|
||||
"description": "use builds instead"
|
||||
},
|
||||
"force_token": {
|
||||
"type": "string",
|
||||
@ -2843,8 +2837,7 @@
|
||||
},
|
||||
"bucket": {
|
||||
"$ref": "#/$defs/RepoRef",
|
||||
"description": "use repository instead",
|
||||
"deprecated": true
|
||||
"description": "use repository instead"
|
||||
},
|
||||
"repository": {
|
||||
"$ref": "#/$defs/RepoRef"
|
||||
@ -3333,8 +3326,7 @@
|
||||
"type": "boolean"
|
||||
}
|
||||
],
|
||||
"description": "you can now remove this",
|
||||
"deprecated": true
|
||||
"description": "you can now remove this"
|
||||
},
|
||||
"templated_files": {
|
||||
"items": {
|
||||
@ -3680,9 +3672,15 @@
|
||||
"publisher_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"publisher_support_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"copyright": {
|
||||
"type": "string"
|
||||
},
|
||||
"copyright_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"author": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -3740,6 +3738,12 @@
|
||||
},
|
||||
"release_notes_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"tags": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
|
Loading…
x
Reference in New Issue
Block a user