New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nfpms overrides and replacements deprecation #3792
Comments
ah, nice catch! |
closes #3792 Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
Thank you for the fast response! Is there any non-deprecated way to achieve this same functionality though? I didn't see any template variables that could be used in |
it should work the same as with the archives name templates... are you getting an error? if so, please share the config + output and I'll have a look :) |
No error, I just can't find a variable that represents the format ("rpm" vs "deb" vs "apk") in order to do conditional logic in the template for use in For example, if I want to replace "arm64" with "aarch64" only on rpm and apk, but not deb, how do you do this in I attempted something like file_name_template: >-
{{- .ProjectName }}-
{{- .Version}}.
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "arm64" }}
{{- if eq .ArtifactExt "deb" }}arm64{{ else }}aarch64{{ end }}
{{- end }} Thanks for the assistance, much appreciated! |
On second thought -- after tweaking some of my automation pipeline, I was able to successfully switch to Not sure if anyone else out there was relying on |
yeah, conventional file name is clearer, you're right though, there should be a variable for that. will add another issue, thanks! |
What happened?
nfpms.replacements
was deprecated in #3589, and the deprecation warning does indeed work properly if you usenfpms.replacements
directly. However, the deprecation warning isn't generated if format-specific overrides use the replacements field.For example, using
nfpms.overrides.rpm.replacements
doesn't seem to trigger the deprecation warning. But I assume this usage is still deprecated.On a related topic, is there any non-deprecated way to achieve this functionality? For example, if I want to replace "arm64" with "aarch64" only on rpm and apk, but not deb, is there any way to do this in
file_name_template
? I couldn't find a template variable that reflects the format or extension for nfpm use-cases.I understand that the preferred approach now is to use
.ConventionalFileName
, and that makes sense for new projects. But for an existing project, changing to this will result in different file names than were used previously, which is non-ideal (it will break downstream users whose automation assumes the name format isn't changing)How can we reproduce this?
This is just a partial snippet to demonstrate the problem (no deprecation warning is generated)
goreleaser version
GoReleaser Check
Search
Code of Conduct
Additional context
Thank you for creating GoReleaser and nFPM, it's wonderful software!
The text was updated successfully, but these errors were encountered: