`package` subcommand
Is your feature request related to a problem? Please describe.
While adding a new packaging format to an app or investigating a packaging specific bug, it's often necessary to run the packaging step several times to configure it correctly. This often doesn't require rebuilding the executable, but rather just edits to the .goreleaser.yaml file and re-packaging. .
Describe the solution you'd like
A package subcommand would make this far easier. The following options would be nice for me:
--nobuild- don't build, just use the existing binary in thedistdirectory. (Or default to--nobuildand have a--buildto re-run the build.)- A way to select which packaging/archive format to use, and potentially which platform. Perhaps a combination of packaging type (e.g.
nfpmsorsnapcrafts),ids, and other specifics (such asGOOS,GOARCHand maybeformats)?
Describe alternatives you've considered
My current solution is as follows:
- Comment out all builds/releases in
.goreleaser.yamlexcept the one I want to use. - Set any
goosandgoarchvalues to be strictly the platform I want to package for. - Start making changes
- Test those changes with
goreleaser release --snapshot --rm-dist
A package subcommand could replace that with, for example, goreleaser package --nobuild --single-platform snapcrafts to package the already-built software as a snap for my current platform.
Search
- I did search for other open and closed issues before opening this.
Code of Conduct
- I agree to follow this project's Code of Conduct
Additional context
The most relevant other issue I found was #3219. I think a package subcommand would solve that use case as well.
Source: goreleaser/goreleaser