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.
|
|
|
|
enabled: true
|
|
|
|
|
|
|
|
# Name template of the final archive.
|
2023-04-02 17:16:21 -03:00
|
|
|
#
|
2024-06-19 11:44:22 -03:00
|
|
|
# Default: '{{ .ProjectName }}-{{ .Version }}'.
|
|
|
|
# Templates: allowed.
|
2023-07-06 16:51:23 +00:00
|
|
|
name_template: "{{ .ProjectName }}"
|
2020-04-12 11:47:46 -03:00
|
|
|
|
|
|
|
# Format of the archive.
|
2023-04-07 22:53:15 -03:00
|
|
|
#
|
|
|
|
# Valid formats are: tar, tgz, tar.gz, and zip.
|
2023-04-02 17:16:21 -03:00
|
|
|
#
|
2024-06-19 11:44:22 -03:00
|
|
|
# Default: 'tar.gz'.
|
2023-07-06 16:51:23 +00:00
|
|
|
format: "tar"
|
2021-11-02 23:57:20 +01:00
|
|
|
|
2023-04-02 17:16:21 -03:00
|
|
|
# Prefix.
|
2021-11-02 23:57:20 +01:00
|
|
|
# String to prepend to each filename in the archive.
|
2023-04-02 17:16:21 -03:00
|
|
|
#
|
2024-06-19 11:44:22 -03:00
|
|
|
# Templates: allowed.
|
2023-07-06 16:51:23 +00:00
|
|
|
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.
|
|
|
|
rlcp: true
|
|
|
|
|
2023-04-02 17:16:21 -03:00
|
|
|
# Additional files/globs you want to add to the source archive.
|
2022-09-11 16:54:51 -03:00
|
|
|
#
|
2024-06-19 11:44:22 -03:00
|
|
|
# Templates: allowed.
|
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
|
2023-07-06 16:51:23 +00:00
|
|
|
- src: "*.md"
|
2022-08-25 02:15:37 -03:00
|
|
|
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
|
|
|
|
2024-04-01 10:01:56 -03:00
|
|
|
# Strip parent directories when adding files to the archive.
|
2022-08-25 02:15:37 -03:00
|
|
|
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.
|
2024-06-19 11:44:22 -03:00
|
|
|
# Default: file info of the source file.
|
2022-08-25 02:15:37 -03:00
|
|
|
info:
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
# format is `time.RFC3339Nano`
|
|
|
|
mtime: 2008-01-02T15:04:05Z
|
2023-03-29 22:23:53 -03:00
|
|
|
|
|
|
|
# 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.
|
|
|
|
#
|
2023-03-30 13:26:03 -03:00
|
|
|
# This feature is only available in GoReleaser Pro.
|
2024-06-19 11:44:22 -03:00
|
|
|
# Templates: allowed.
|
2023-07-06 16:51:23 +00:00
|
|
|
templated_files:
|
2023-03-29 22:23:53 -03:00
|
|
|
# a more complete example, check the globbing deep dive below
|
2023-07-06 16:51:23 +00:00
|
|
|
- src: "LICENSE.md.tpl"
|
2023-03-29 22:23:53 -03:00
|
|
|
dst: LICENSE.md
|
|
|
|
info:
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
mtime: 2008-01-02T15:04:05Z
|
2020-04-12 11:47:46 -03:00
|
|
|
```
|
|
|
|
|
2024-07-08 23:30:10 -03:00
|
|
|
{% include-markdown "../includes/templates.md" comments=false %}
|