2023-06-05 19:08:57 +03:00
|
|
|
// Package pipeline provides generic errors for pipes to use.
|
2016-12-30 09:27:35 -02:00
|
|
|
package pipeline
|
|
|
|
|
2018-09-12 14:18:01 -03:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2021-05-25 00:19:06 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/announce"
|
2018-09-12 14:18:01 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/archive"
|
2022-01-20 14:59:39 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/aur"
|
2018-09-12 14:18:01 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/before"
|
2021-09-18 10:21:29 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/brew"
|
2018-09-12 14:18:01 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/build"
|
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/changelog"
|
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/checksums"
|
feat: chocolatey support (#3509)
This PR adds support for generating the structure used to pack and push
Chocolatey Packages. And will solve the #3154
Is not ready for merge yet, but has the main structure, and ready for
comments.
Accordingly to Chocolatey, in order to build a package, it's necessary a
`.nuspec` and `chocolateyinstall.ps1` files at least, having these ones,
we could pack and distribute without adding the binary inside the final
package and that was implemented here.
To complete, will be necessary to define the package build and
distribute, however will be required to have Chocolatey installed
(Windows Only). One of alternatives that I thought was, publish the
files like Scoop and Brew in a separate repository, and there we could
use `chocolatey` through
[crazy-max/ghaction-chocolatey](https://github.com/crazy-max/ghaction-chocolatey).
Chocolatey has a lot of good examples of repositories:
https://github.com/chocolatey-community/chocolatey-packages/tree/master/automatic/curl
A final compilation of the missing parts:
- [x] How to pack and push (chocolatey)
- [x] Documentation
Sorry for the long description😄
All feedback very welcome!
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2022-11-12 03:52:32 +01:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/chocolatey"
|
2018-09-12 14:18:01 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/defaults"
|
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/dist"
|
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/docker"
|
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/effectiveconfig"
|
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/env"
|
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/git"
|
2021-09-11 14:46:30 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/gomod"
|
2021-11-11 09:37:58 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/krew"
|
2022-01-23 16:42:42 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/metadata"
|
2018-09-12 14:18:01 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/nfpm"
|
2023-05-25 23:07:10 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/nix"
|
2024-04-19 22:27:50 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/notary"
|
2023-11-27 18:29:50 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/partial"
|
2022-01-14 10:33:11 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/prebuild"
|
2018-10-05 09:22:53 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/publish"
|
2023-04-23 20:27:16 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/reportsizes"
|
2021-12-11 22:21:51 -05:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/sbom"
|
2021-09-18 10:21:29 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/scoop"
|
2021-09-11 14:46:30 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/semver"
|
2018-09-12 14:18:01 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/sign"
|
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/snapcraft"
|
2018-12-13 10:09:36 -02:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/snapshot"
|
2021-09-11 14:46:30 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/sourcearchive"
|
2021-10-12 14:55:43 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/universalbinary"
|
2023-05-01 21:22:05 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/upx"
|
2023-06-14 23:59:55 -03:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/winget"
|
2018-09-12 14:18:01 -03:00
|
|
|
"github.com/goreleaser/goreleaser/pkg/context"
|
|
|
|
)
|
|
|
|
|
2021-05-25 00:19:06 -03:00
|
|
|
// Piper defines a pipe, which can be part of a pipeline (a series of pipes).
|
2018-09-12 14:18:01 -03:00
|
|
|
type Piper interface {
|
|
|
|
fmt.Stringer
|
|
|
|
|
|
|
|
// Run the pipe
|
|
|
|
Run(ctx *context.Context) error
|
2017-08-20 16:35:46 -03:00
|
|
|
}
|
|
|
|
|
2020-11-27 02:16:08 +00:00
|
|
|
// BuildPipeline contains all build-related pipe implementations in order.
|
2020-05-15 15:19:20 +01:00
|
|
|
// nolint:gochecknoglobals
|
|
|
|
var BuildPipeline = []Piper{
|
2022-10-06 15:21:45 -03:00
|
|
|
// load and validate environment variables
|
|
|
|
env.Pipe{},
|
|
|
|
// get and validate git repo state
|
|
|
|
git.Pipe{},
|
|
|
|
// parse current tag to a semver
|
|
|
|
semver.Pipe{},
|
|
|
|
// load default configs
|
|
|
|
defaults.Pipe{},
|
2023-11-27 18:29:50 -03:00
|
|
|
// setup things for partial builds/releases
|
|
|
|
partial.Pipe{},
|
2022-10-06 15:21:45 -03:00
|
|
|
// snapshot version handling
|
|
|
|
snapshot.Pipe{},
|
2023-08-15 12:29:37 +00:00
|
|
|
// run global hooks before build
|
|
|
|
before.Pipe{},
|
2022-10-06 15:21:45 -03:00
|
|
|
// ensure ./dist is clean
|
|
|
|
dist.Pipe{},
|
2024-03-26 23:41:41 -03:00
|
|
|
// setup metadata options
|
|
|
|
metadata.Pipe{},
|
2024-04-01 10:01:56 -03:00
|
|
|
// creates a metadta.json files in the dist directory
|
2024-03-26 23:41:41 -03:00
|
|
|
metadata.MetaPipe{},
|
2022-10-06 15:21:45 -03:00
|
|
|
// setup gomod-related stuff
|
|
|
|
gomod.Pipe{},
|
|
|
|
// run prebuild stuff
|
|
|
|
prebuild.Pipe{},
|
|
|
|
// proxy gomod if needed
|
2023-11-03 21:42:09 -03:00
|
|
|
gomod.CheckGoModPipe{},
|
|
|
|
// proxy gomod if needed
|
2022-10-06 15:21:45 -03:00
|
|
|
gomod.ProxyPipe{},
|
|
|
|
// writes the actual config (with defaults et al set) to dist
|
|
|
|
effectiveconfig.Pipe{},
|
|
|
|
// build
|
|
|
|
build.Pipe{},
|
|
|
|
// universal binary handling
|
|
|
|
universalbinary.Pipe{},
|
2024-04-19 22:27:50 -03:00
|
|
|
// notarize macos apps
|
|
|
|
notary.MacOS{},
|
2023-05-01 21:22:05 -03:00
|
|
|
// upx
|
|
|
|
upx.Pipe{},
|
2017-08-20 16:35:46 -03:00
|
|
|
}
|
2020-05-15 15:19:20 +01:00
|
|
|
|
2021-12-01 09:54:58 -03:00
|
|
|
// BuildCmdPipeline is the pipeline run by goreleaser build.
|
|
|
|
// nolint:gochecknoglobals
|
2023-04-30 17:00:43 +00:00
|
|
|
var BuildCmdPipeline = append(
|
|
|
|
BuildPipeline,
|
|
|
|
reportsizes.Pipe{},
|
2024-03-26 23:41:41 -03:00
|
|
|
metadata.ArtifactsPipe{},
|
2023-04-30 17:00:43 +00:00
|
|
|
)
|
2021-12-01 09:54:58 -03:00
|
|
|
|
2020-11-27 02:16:08 +00:00
|
|
|
// Pipeline contains all pipe implementations in order.
|
2020-05-15 15:19:20 +01:00
|
|
|
// nolint: gochecknoglobals
|
|
|
|
var Pipeline = append(
|
|
|
|
BuildPipeline,
|
2022-11-02 13:08:32 -03:00
|
|
|
// builds the release changelog
|
|
|
|
changelog.Pipe{},
|
2022-10-06 15:21:45 -03:00
|
|
|
// archive in tar.gz, zip or binary (which does no archiving at all)
|
|
|
|
archive.Pipe{},
|
|
|
|
// archive the source code using git-archive
|
|
|
|
sourcearchive.Pipe{},
|
|
|
|
// archive via fpm (deb, rpm) using "native" go impl
|
|
|
|
nfpm.Pipe{},
|
|
|
|
// archive via snapcraft (snap)
|
|
|
|
snapcraft.Pipe{},
|
|
|
|
// create SBOMs of artifacts
|
|
|
|
sbom.Pipe{},
|
|
|
|
// checksums of the files
|
|
|
|
checksums.Pipe{},
|
|
|
|
// sign artifacts
|
|
|
|
sign.Pipe{},
|
|
|
|
// create arch linux aur pkgbuild
|
|
|
|
aur.Pipe{},
|
2023-05-25 23:07:10 -03:00
|
|
|
// create nixpkgs
|
|
|
|
nix.NewBuild(),
|
2023-06-14 23:59:55 -03:00
|
|
|
// winget installers
|
|
|
|
winget.Pipe{},
|
2022-10-06 15:21:45 -03:00
|
|
|
// create brew tap
|
|
|
|
brew.Pipe{},
|
|
|
|
// krew plugins
|
|
|
|
krew.Pipe{},
|
|
|
|
// create scoop buckets
|
|
|
|
scoop.Pipe{},
|
feat: chocolatey support (#3509)
This PR adds support for generating the structure used to pack and push
Chocolatey Packages. And will solve the #3154
Is not ready for merge yet, but has the main structure, and ready for
comments.
Accordingly to Chocolatey, in order to build a package, it's necessary a
`.nuspec` and `chocolateyinstall.ps1` files at least, having these ones,
we could pack and distribute without adding the binary inside the final
package and that was implemented here.
To complete, will be necessary to define the package build and
distribute, however will be required to have Chocolatey installed
(Windows Only). One of alternatives that I thought was, publish the
files like Scoop and Brew in a separate repository, and there we could
use `chocolatey` through
[crazy-max/ghaction-chocolatey](https://github.com/crazy-max/ghaction-chocolatey).
Chocolatey has a lot of good examples of repositories:
https://github.com/chocolatey-community/chocolatey-packages/tree/master/automatic/curl
A final compilation of the missing parts:
- [x] How to pack and push (chocolatey)
- [x] Documentation
Sorry for the long description😄
All feedback very welcome!
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2022-11-12 03:52:32 +01:00
|
|
|
// create chocolatey pkg and publish
|
|
|
|
chocolatey.Pipe{},
|
2023-04-23 20:27:16 -03:00
|
|
|
// reports artifacts sizes to the log and to artifacts.json
|
|
|
|
reportsizes.Pipe{},
|
2022-10-06 15:21:45 -03:00
|
|
|
// create and push docker images
|
|
|
|
docker.Pipe{},
|
|
|
|
// publishes artifacts
|
2023-06-20 09:33:59 -03:00
|
|
|
publish.New(),
|
2024-04-01 10:01:56 -03:00
|
|
|
// creates a artifacts.json files in the dist directory
|
2024-03-26 23:41:41 -03:00
|
|
|
metadata.ArtifactsPipe{},
|
2022-10-06 15:21:45 -03:00
|
|
|
// announce releases
|
|
|
|
announce.Pipe{},
|
2020-05-15 15:19:20 +01:00
|
|
|
)
|