1
1
Fork 0
mirror of https://github.com/goreleaser/nfpm synced 2024-05-13 15:46:15 +02:00
Commit Graph

91 Commits

Author SHA1 Message Date
Carlos Alexandro Becker 7d6a77bee6
test: fix arch tests 2023-05-24 02:42:13 +00:00
Carlos Alexandro Becker 6dc5db365b
test: fix deb/rpm tests
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-05-21 23:05:10 +00:00
Carlos Alexandro Becker 312fd85338
fix: improve goarch to pkg conversion
also added tests

refs https://github.com/goreleaser/goreleaser/issues/3998
2023-05-18 01:24:50 +00:00
Erik G bc3e6973ea
feat: refactor contents handling and add tree content type (#618)
* feat: Refactor contents handling and add tree content type.

* fix:  Remove unnecessary deprecation warning.

* doc: Document tree type.

* fix: Remove superfluous error check.

* fix: Fix directory and symlink file info for tree content type.

* fix: Fix archlinux directories and file infos.

* fix: Early out in withChangelogIfRequested

* fix: Remove ExpandContentGlobs.
2023-02-19 10:16:51 -03:00
Erik G d56fbe2958
feat: add zstd compression support for deb and rpm (#611) 2023-01-30 00:24:27 -03:00
Carlos Alexandro Becker daae772558
fix: do not allow empty items in deb.provides (#606)
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2023-01-23 22:44:22 -03:00
Carlos Alexandro Becker c816571b14
test: improve test code (#602)
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2023-01-07 16:51:49 -03:00
Anders Björklund c195d93dfb
feat: expand variables in platform field (#601)
* feat: expand variables in platform field

Surprising that GOARCH was expanded, but GOOS was not.

More consistent to expand both of them the same way ?

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>

* fix: check platform for all packagers

Implement platform for deb packager, goes into Architecture.

Validate that the platform is "linux", for Alpine and Arch.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2023-01-07 16:35:57 -03:00
Carlos Alexandro Becker f2e5d2a1e3
fix(deb): changelog fixes (#597)
* fix(deb): changelog fixes

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Andrei Belov <defanator@users.noreply.github.com>

* fix: test

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

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Andrei Belov <defanator@users.noreply.github.com>
2022-12-29 22:25:49 -03:00
Carlos Alexandro Becker dedee6d6b1
fix: do not encourage using /usr/local/bin (#596)
* fix: do not encourage using /usr/local/bin

Examples, tests and docs often refer to /usr/local/bin, which should
only be used for things compiled locally, which is not the case of
installed packages.

Changed that to /usr/bin, and also some usages of things like
/usr/something to /usr/share/something.

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

* fix: complex test

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

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-12-29 22:19:38 -03:00
Carlos Alexandro Becker 2918f99b60
fix: improve contents.type (#581)
* fix: improve contents.type

improved jsonschema and added validations

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

* fix: config|noreplace

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

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-24 10:12:29 -03:00
Carlos Alexandro Becker 5c3cc38943
fix: archlinux globs (#574)
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-12 00:50:16 -03:00
Carlos A Becker 46d2a44a13
test: improve coverage a bit 2022-10-15 14:58:33 -03:00
Carlos Alexandro Becker 437d9ef31a
feat: upgrade to go 1.19 (#542)
* refactor: remove usage of ioutil

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

* fix(ci): actually use go 1.19

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

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-08-22 09:39:40 -03:00
Carlos A Becker 47d15255b0
Revert "feat: removing changelog generation"
This reverts commit 816dd05151.
2022-08-10 00:46:47 -03:00
Carlos A Becker 816dd05151
feat: removing changelog generation
breaking change: removing changelog generation from nfpm... users will now have to provide a changelog file/data according to the format they are using

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-08-10 00:45:33 -03:00
Sas Swart 1eb3837edc
feat: implement dpkg-sig Package signing (#508)
* implement dpkg-sig Package signing

* Fix dpkgsig template syntax

* Fix dpkgsig template syntax

* Correctly handle template errors when reading dpkg-sig templates

* Fix dkpgsig signature templateing
2022-05-30 10:34:45 -03:00
Kyle Penfound 170bf81da5
fix: deb version order in control (#498) 2022-04-22 15:25:37 -03:00
Aaron Jacobs 98a59ec16d
feat: add support for additional fields in Debian control files (#491)
Debian control files (DCF) have a number of optional fields [0] --
including "Bugs" and "Tags" -- that are used by many existing packages.
The original fpm supports adding arbitrary fields to DCFs with the
--deb-field flag [1], but until now it was not possible to do so with
nfpm.

This commit introduces a new deb-specific override, "fields", that
simply translates key-value pairs from a map directly into the DCF.
Given the following nfpm config file entry:

    deb:
      fields:
        Bugs: https://github.com/goreleaser/nfpm/issues

The resulting DCF would contain the entry

    Bugs: https://github.com/goreleaser/nfpm/issues

To avoid generating malformed DCFs, we simply ignore empty entries.

This commit includes unit tests and updates to the website
documentation.

Closes #490.

[0]: https://man7.org/linux/man-pages/man5/deb-control.5.html
[1]: https://fpm.readthedocs.io/en/latest/packages/deb.html?highlight=changelog#deb-specific-command-line-flags

Signed-off-by: Aaron Jacobs <aaron.jacobs@rstudio.com>
2022-04-06 14:38:10 -03:00
Mikhail f. Shiryaev c049e1c2f9
fix: processing symlinks in directories (#453)
* fix: proceed symlinks in contents as is

* Remove dead code

* fix: make OS independent test
2022-02-11 22:47:18 -03:00
Carlos Alexandro Becker d16adac8c3
fix: create tree of dir content types (#431)
* fix(apk): create tree of dir types

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>

* fix: create tree of dir contents

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>

* test: fixes

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2021-12-28 14:24:49 -03:00
Erik Geiser e959f1d7c3
fix: prevent duplicate folders from being created (#411)
* fix: Prevent duplicate folders from being created.

* Fix apk filename convention.
2021-12-01 11:38:15 -03:00
Erik G 4f5362102c
feat: directory content type with custom attributes (#390)
* Deprecate EmptyFolders and introduce dir contents.

* Handle explicit dirs with attributes correctly for Debs.

* Handle explicit dirs with attributes correctly for Apks.

* Sort contents by fields that are most relevant for the package.

* Make deprecation warning for empty_folders consistent.

* Name RPM directory tag more consistently.

* Fix deprecation notice in docs.

* Fix directory normalization for Debs and Apks.

* Revert Apk builder size in tests.

* Fix file sorting.

* Fix deprecated EmptyFolders handling in info.Validate.

* Fix Apk builder size in tests.

* Only stat content source when necessary.

* Allow src on dir content.

* Small addition to file_info docs.

* Fix typo in comments.

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* Remove content type fallthrough case.

* Fix typo in apk tests.

* Fix more typos.

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2021-11-11 22:58:59 -03:00
Carlos Alexandro Becker e05fb50648
fix: added more arches (#398)
* fix: added more arches

* fix: code review
2021-11-07 22:57:56 -03:00
Carlos A Becker 2e30111d86
chore: user require instead of assert 2021-11-07 10:51:13 -03:00
Carlos A Becker fb0a007440
chore: fmt
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2021-10-12 14:42:00 -03:00
Drew Stinnett 56c46c6d50
feat: enforce packager defaults (#372)
* feat: apply defaults to required deb values

* feat: Adding default info to config documentation

* fix: cleanup comments

* refactor: implementing refactor from PR discussion

* fix: making deprecation warning more clear
2021-10-11 09:50:43 -03:00
Kyle Penfound 4210500f66
fix: release at end of version string (#375)
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2021-10-10 14:44:47 -03:00
Erik G 2a331c5c7f
feat: compression option with xz support for deb (#363) 2021-09-04 10:24:52 -03:00
Carlos Alexandro Becker 273b612558
feat: upgrade fileglob (#306)
* feat: upgrade fileglob

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: update

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: quotemeta opt

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: quotemeta

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: fmt

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2021-03-01 11:27:05 -03:00
Carlos Alexandro Becker bf4f92763d
feat(ci): lint action, gocenter, tools (#304)
* feat(ci): lint action, gocenter, tools

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: fmt

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: lint issues

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: go generate

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2021-02-27 17:15:05 +00:00
dependabot-preview[bot] 4bf2575c1c
chore(deps): bump github.com/golangci/golangci-lint from 1.33.0 to 1.34.0 (#271)
* chore(deps): bump github.com/golangci/golangci-lint

Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.33.0 to 1.34.0.
- [Release notes](https://github.com/golangci/golangci-lint/releases)
- [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/golangci/golangci-lint/compare/v1.33.0...v1.34.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* fix: linting issues

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: simplify golangci-lint config

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: simplify golangci-lint config

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-12-29 12:29:59 -03:00
Carlos Alexandro Becker 62357a65e2
feat: version as v2 (#268)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-12-23 13:25:57 +00:00
Carlos Alexandro Becker 19817233b5
feat: remove deprecated options (#267)
* feat: remove deprecated options

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: fixing

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: configs

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: tempdir

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: fmt

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* feat: go 1.15

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: fix

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: fix

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: fix

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* refactor: test

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: lint

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: import

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: test

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: symlink

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-12-22 21:28:32 -03:00
Dj Gilcrease c4ae30d749
feat: try to clean up and simplify the file adding interface (#255)
* feat: cleanup and simplify the file adding interface

* docs: update the configuration docs to focus on the new contents format for specifying files

* docs: correct spelling

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2020-12-15 13:47:00 -03:00
Dj Gilcrease 8535159b05
fix: ensure nfpm can run on windows and still build correct rpm, deb, and apk packages (#262)
* fix: ensure nfpm can run on windows and still build correct rpm, deb, and apk packages

fix: add windows test job

* fix: ensure file close happens in the correct order on windows

* fix: ensure eol is set to lf

* chore: update the go version to be consistent between windows and ubuntu

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* chore: update comments

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* chore: rerun make deps

* chore: fix .gitattributes to ensure images are not touched

* chore: run make fmt

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2020-12-09 18:28:30 +00:00
Carlos Alexandro Becker 7feb0818ff
fix: invalid zip file (#253)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-11-10 18:25:58 -03:00
Carlos Alexandro Becker 105a426161
chore(deps): bump github.com/golangci/golangci-lint from 1.31.0 to 1.32.2 (#251)
* chore(deps): bump github.com/golangci/golangci-lint from 1.31.0 to 1.32.2

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: errors.is

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: typo

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: typo

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: fix

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-11-10 10:35:00 -03:00
Erik G 7839385b21
feat: add an option to disable globbing (#248)
* feat: Add option to disable globbing.

* test: Fix failing tests.

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2020-11-10 09:37:29 -03:00
Carlos Alexandro Becker b93d8e6452 test: fix
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-11-10 09:34:52 -03:00
Carlos Alexandro Becker a83e6466a0
feat: replace glob library (#244)
* feat: replace glob library

BREAKING CHANGE: may have unintended side-effects.

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: delimiter and patterns starting with ./

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: use fileglob

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: fixed some wrong tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-11-08 17:09:12 -03:00
Ivan Vandot 7a70791bb0
feat: add support for deb templates (#240)
* add support for deb templates

* merge scripts and templates, make mode settable and move Templates to DebScripts

* add templates support to docs
2020-11-03 09:44:59 -03:00
Carlos Alexandro Becker 3d7580ade2
refactor: remove pkg/errors (#226)
* refactor: remove pkg/errors

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: lint

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-09-19 17:06:07 -03:00
Erik G 285a6bcaea
feat: Package Signing (#224)
* feat: Add initial openpgp signing capability.

* refactor: Rename signatures to sigs and expose verify method.

* feat: Add debsigs support.

* test: Add debsigs acceptance test.

* feat: Add RSA signing capability.

* feat: Add RPM signature support.

* test: Add RPM signature acceptance test.

* test: Move acceptance test keys in dedicated folder.

* feat: Add APK signature support.

* test: Add APK signature acceptance test.

* feat: Expose deb signature type in config.

* fix: Fix typo and superfluous explicit error check

* fix: Fix password env extraction and add tests.

* fix: Redirect rpmpack to temporary goreleaser vendoring.

* fix: Catch missing maintainer email if no apk key name is set.

* refactor: Put signature info in a dedicated struct.

* doc: Add signing documentation.

* fix: Add trailing newlines to some files and remove unnecessary comment.

* fix: Change wrong references from SHA256 to SHA1 in the sign package.

* fix: Improve error wording when no passphrase was provided.

* fix: Remove another SHA256 reference.

* fix: Fix signature errors.

* test: Split up environment variable test.

* fix: Don't parse passphrase from YAML.

* deps: Update redirected rpmpack.

* fix: Export and use signature related error type.

* doc: Document ErrSigningFailure.

* test: Fix apk signature error test.

* test: Add rpm signature error test.
2020-09-17 09:18:44 -03:00
Erik G 59de11a9e4
fix: deb file path prefixes and md5sums file (#218)
* fix: Ensure relative path prefix for deb packages

This patch ensures that all items contained in tar.gz files in Debian
packages have a relative path prefix, so the names all start with "./".
While this is not strictly required for a Debian package to function,
detecting a changed config file fails with an error messages similar to
the following:

    tar: ./etc/default/conffilename: Not found in archive

It seems to fail extracting config files for checking if they have been
modified by the system administrator.

All reference documentation that I was able to find (e.g. in the Debian
Handbook[1]) shows that all paths contained in either data.tar.gz and
control.tar.gz have the prefix "./".

I've verified that with this change, config files works as expected.

[1] https://debian-handbook.info/browse/stable/packaging-system.html#sect.binary-package-structure

* fix: Remove dpkg filters for changelog acceptance test.

* fix: Fix broken md5sums file when a changelog is added.

Co-authored-by: Alexander Neumann <alexander.neumann@redteam-pentesting.de>
2020-08-24 16:34:28 -03:00
Erik G 0c25629af7
feat: Introduce version_metadata for all packagers and deprecate deb.metadata. (#215) 2020-08-20 01:00:17 -03:00
Erik G 62c61a56bd
fix: Remove leading slashes from files in .tag.gz files in deb. (#209)
* fix: Remove leading slashes from symlinks and changelog in deb.

* test: Test that deb .tar.gz files don't contain leading slashes.

* fix: Fix acceptance tests by removing slashes globally.
2020-08-17 14:12:23 -03:00
Erik G 3cc1ea4186
test: Changed some asserts to requires for early out in tests. (#195)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-08-04 17:55:52 +00:00
Erik G 0000a2fe8d
feat: support symlinks for deb and rpm. (#185)
* feat: Support symlinks.

* fix: Fix symlink creation for deb.

* fix: Remove magic number in rpm symlink creation.

* test: Add symlink unit tests.

* test: Add symlink acceptance tests.

* doc: Add documentation for symlinks.

* fix: Fix acceptance test name.

* fix: Make symlink headers more consistent.
2020-07-29 23:20:50 -03:00
Erik G 0b4025a8f2
feat: Add support for DEB triggers. (#178)
* feat: Add support for DEB triggers.

* fix: Fix trigger test package description.

* fix: Use correct trigger keys in configuration documentation.
2020-07-27 13:22:06 -03:00