Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat: nfpm changelog support (#3309)
closes #3259

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
  • Loading branch information
caarlos0 committed Aug 16, 2022
1 parent c83663c commit 3f60327
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .goreleaser.yaml
Expand Up @@ -67,8 +67,6 @@ changelog:
- title: Other work
order: 9999



dockers:
- image_templates:
- 'goreleaser/goreleaser:{{ .Tag }}-amd64'
Expand Down
1 change: 1 addition & 0 deletions internal/pipe/nfpm/nfpm.go
Expand Up @@ -252,6 +252,7 @@ func create(ctx *context.Context, fpm config.NFPM, format string, binaries []*ar
Vendor: fpm.Vendor,
Homepage: homepage,
License: fpm.License,
Changelog: fpm.Changelog,
Overridables: nfpm.Overridables{
Conflicts: overridden.Conflicts,
Depends: overridden.Dependencies,
Expand Down
1 change: 1 addition & 0 deletions internal/pipe/nfpm/nfpm_test.go
Expand Up @@ -100,6 +100,7 @@ func TestRunPipe(t *testing.T) {
Maintainer: "me@me",
Vendor: "asdf",
Homepage: "https://goreleaser.com/{{ .Env.PRO }}",
Changelog: "./testdata/changelog.yaml",
NFPMOverridables: config.NFPMOverridables{
FileNameTemplate: defaultNameTemplate + "-{{ .Release }}-{{ .Epoch }}",
PackageName: "foo",
Expand Down
23 changes: 23 additions & 0 deletions internal/pipe/nfpm/testdata/changelog.yaml
@@ -0,0 +1,23 @@
- semver: 0.2.2
date: 2022-08-15T23:28:59-03:00
packager: GitHub <noreply@github.com>
changes:
- commit: 4864bcced8ccc6b0428b237aa75e5c6b7e56fa69
note: 'fix: force old version of go-git to avoid go-crypto issues'
author:
name: Carlos A Becker
email: caarlos0@users.noreply.github.com
committer:
name: Carlos A Becker
email: caarlos0@users.noreply.github.com
- commit: 1893f0b7a809699baf5138569de677a0a5de0445
note: 'fix: old go-crypto version'
author:
name: Carlos A Becker
email: caarlos0@users.noreply.github.com
committer:
name: Carlos A Becker
email: caarlos0@users.noreply.github.com
- semver: 0.2.1
date: 2022-08-15T22:44:59-03:00
packager: GitHub <noreply@github.com>
1 change: 1 addition & 0 deletions pkg/config/config.go
Expand Up @@ -543,6 +543,7 @@ type NFPM struct {
Description string `yaml:"description,omitempty" json:"description,omitempty"`
License string `yaml:"license,omitempty" json:"license,omitempty"`
Bindir string `yaml:"bindir,omitempty" json:"bindir,omitempty"`
Changelog string `yaml:"changelog,omitempty" json:"changelog,omitempty"`
Meta bool `yaml:"meta,omitempty" json:"meta,omitempty"` // make package without binaries - only deps
}

Expand Down
10 changes: 10 additions & 0 deletions www/docs/customization/nfpm.md
Expand Up @@ -126,6 +126,16 @@ nfpms:
# Defaults to false.
meta: true

# Changelog YAML file, see: https://github.com/goreleaser/chglog
#
# You can use goreleaser/chglog to create the changelog for your project,
# pass that changelog yaml file to GoReleaser,
# and it should in turn setup it accordingly for the given available
# formats (deb and rpm at the moment).
#
# Experimental.
changelog: ./foo.yml

# Contents to add to the package.
# GoReleaser will automatically add the binaries.
contents:
Expand Down

0 comments on commit 3f60327

Please sign in to comment.