Three packagers for macOS, built in pure Go on any platform: - pkg: an installer package (.pkg) from contents and the preinstall and postinstall scripts, as a product archive that declares its architecture. - app: an application bundle delivered as a zip (.app.zip), with a generated Info.plist. - dmg: the same bundle in a disk image (.dmg) next to a link to the Applications folder. app and dmg share the new "app" settings; pkg has its own. All three take name, version, arch and contents from the shared fields, can be signed with a PKCS#12 identity, and report the shared settings macOS has no place for instead of dropping them silently. Refs #535, #536. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
1.7 KiB
title, weight
| title | weight |
|---|---|
| Quick Start | 1 |
nFPM can be used both as a command line tool or as a Go library.
Getting Started
{{% steps %}}
Install nFPM
You can choose from several instalation methods, for example:
Using Homebrew:
brew install goreleaser/tap/nfpm
Using go install:
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
Make sure to check the complete list and choose the best option for your case.
Initialize your project
Use nfpm init to create a sample configuration:
nfpm init
This creates a nfpm.yaml file with a commented example configuration.
Build your packages
Use nfpm package to create your packages:
# Build specific formats
nfpm pkg --packager deb --target /tmp/
nfpm pkg --packager rpm --target /tmp/
nfpm pkg --packager apk --target /tmp/
You can also use ipk, archlinux, msi, msix, and the macOS packagers app, dmg, and pkg.
{{% /steps %}}
Command Line Reference
For more information about available options:
nfpm --help
See the configuration reference to customize your package definition.
Check out the command line reference for detailed documentation of all commands.
Using as a Go library
You can also use nFPM as a library in your Go project.
Check out the GoDocs page, the nFPM command line implementation and GoReleaser's usage.