2021-10-30 09:50:23 -03:00
|
|
|
# Source Archive
|
2020-04-12 11:47:46 -03:00
|
|
|
|
2022-09-17 00:13:09 -03:00
|
|
|
You may add the current tag source archive to the release as well. This is
|
|
|
|
particularly useful if you want to sign it, for example.
|
2020-04-12 11:47:46 -03:00
|
|
|
|
2020-05-10 18:59:21 -03:00
|
|
|
```yaml
|
2021-12-23 01:52:01 +01:00
|
|
|
# .goreleaser.yaml
|
2020-04-12 11:47:46 -03:00
|
|
|
source:
|
|
|
|
# Whether this pipe is enabled or not.
|
|
|
|
# Defaults to `false`
|
|
|
|
enabled: true
|
|
|
|
|
|
|
|
# Name template of the final archive.
|
|
|
|
# Defaults to `{{ .ProjectName }}-{{ .Version }}`
|
|
|
|
name_template: '{{ .ProjectName }}'
|
|
|
|
|
|
|
|
# Format of the archive.
|
|
|
|
# Any format git-archive supports, this supports too.
|
|
|
|
# Defaults to `tar.gz`
|
|
|
|
format: 'tar'
|
2021-11-02 23:57:20 +01:00
|
|
|
|
|
|
|
# Prefix template.
|
|
|
|
# String to prepend to each filename in the archive.
|
|
|
|
# Defaults to empty
|
|
|
|
prefix_template: '{{ .ProjectName }}-{{ .Version }}/'
|
2022-08-25 01:10:26 -03:00
|
|
|
|
feat: better archives relative paths (#3656)
with this patch, a config like:
```yaml
archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of uname.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
rlcp: true
files:
- src: "build/**/*"
dst: .
nfpms:
- package_name: foo
contents:
- src: "build/**/*"
dst: usr/share/foo
formats:
- apk
```
will eval this:
<img width="1384" alt="CleanShot 2022-12-21 at 22 21 00@2x"
src="https://user-images.githubusercontent.com/245435/209034244-7c31b5f7-cfcd-4825-bb2f-7dd463c5286a.png">
as much as I would like to make this the default, it would be a breaking
change, so we really can't do it.
If `dst` is empty, it'll have the same behavior as before (no rlcp), and
if `strip_parent` is set, it will also still have the same behavior.
Finally, if the format is binary, `rlcp` is ignored too (as it doesn't
make sense).
So, this only changes if:
- your format is not binary; and
- you have files with `src` and `dst` set
Then, goreleaser will warn you to set `rlcp: true`.
## todo
- [x] docs
- [x] more tests probably
- [x] any ideas for a better name for the new config option?
fixes #3655
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-12-27 17:42:55 -03:00
|
|
|
# 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.
|
|
|
|
# It will be the default by June 2023.
|
|
|
|
#
|
|
|
|
# Default: false
|
|
|
|
# Since: v1.14.
|
|
|
|
rlcp: true
|
|
|
|
|
2022-08-25 01:10:26 -03:00
|
|
|
# Additional files/template/globs you want to add to the source archive.
|
2022-09-11 16:54:51 -03:00
|
|
|
#
|
|
|
|
# Default: empty.
|
|
|
|
# Since: v1.11.
|
2022-08-25 01:10:26 -03:00
|
|
|
files:
|
|
|
|
- LICENSE.txt
|
|
|
|
- README_{{.Os}}.md
|
|
|
|
- CHANGELOG.md
|
|
|
|
- docs/*
|
|
|
|
- design/*.png
|
|
|
|
- templates/**/*
|
2022-08-25 02:15:37 -03:00
|
|
|
# a more complete example, check the globbing deep dive below
|
|
|
|
- src: '*.md'
|
|
|
|
dst: docs
|
feat: better archives relative paths (#3656)
with this patch, a config like:
```yaml
archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of uname.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
rlcp: true
files:
- src: "build/**/*"
dst: .
nfpms:
- package_name: foo
contents:
- src: "build/**/*"
dst: usr/share/foo
formats:
- apk
```
will eval this:
<img width="1384" alt="CleanShot 2022-12-21 at 22 21 00@2x"
src="https://user-images.githubusercontent.com/245435/209034244-7c31b5f7-cfcd-4825-bb2f-7dd463c5286a.png">
as much as I would like to make this the default, it would be a breaking
change, so we really can't do it.
If `dst` is empty, it'll have the same behavior as before (no rlcp), and
if `strip_parent` is set, it will also still have the same behavior.
Finally, if the format is binary, `rlcp` is ignored too (as it doesn't
make sense).
So, this only changes if:
- your format is not binary; and
- you have files with `src` and `dst` set
Then, goreleaser will warn you to set `rlcp: true`.
## todo
- [x] docs
- [x] more tests probably
- [x] any ideas for a better name for the new config option?
fixes #3655
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-12-27 17:42:55 -03:00
|
|
|
|
2022-08-25 02:15:37 -03:00
|
|
|
# Strip parent folders when adding files to the archive.
|
|
|
|
# Default: false
|
|
|
|
strip_parent: true
|
feat: better archives relative paths (#3656)
with this patch, a config like:
```yaml
archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of uname.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
rlcp: true
files:
- src: "build/**/*"
dst: .
nfpms:
- package_name: foo
contents:
- src: "build/**/*"
dst: usr/share/foo
formats:
- apk
```
will eval this:
<img width="1384" alt="CleanShot 2022-12-21 at 22 21 00@2x"
src="https://user-images.githubusercontent.com/245435/209034244-7c31b5f7-cfcd-4825-bb2f-7dd463c5286a.png">
as much as I would like to make this the default, it would be a breaking
change, so we really can't do it.
If `dst` is empty, it'll have the same behavior as before (no rlcp), and
if `strip_parent` is set, it will also still have the same behavior.
Finally, if the format is binary, `rlcp` is ignored too (as it doesn't
make sense).
So, this only changes if:
- your format is not binary; and
- you have files with `src` and `dst` set
Then, goreleaser will warn you to set `rlcp: true`.
## todo
- [x] docs
- [x] more tests probably
- [x] any ideas for a better name for the new config option?
fixes #3655
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-12-27 17:42:55 -03:00
|
|
|
|
2022-08-25 02:15:37 -03:00
|
|
|
# File info.
|
|
|
|
# Not all fields are supported by all formats available formats.
|
|
|
|
# Defaults to the file info of the actual file if not provided.
|
|
|
|
info:
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
# format is `time.RFC3339Nano`
|
|
|
|
mtime: 2008-01-02T15:04:05Z
|
2020-04-12 11:47:46 -03:00
|
|
|
```
|
|
|
|
|
2020-05-10 18:59:21 -03:00
|
|
|
!!! tip
|
2020-11-19 12:31:26 -08:00
|
|
|
Learn more about the [name template engine](/customization/templates/).
|