Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Showing
10 changed files
with
253 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,6 +142,7 @@ archives: | |
builds_info: | ||
group: root | ||
owner: root | ||
rlcp: true | ||
files: | ||
- README.md | ||
- LICENSE.md | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.