1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-19 20:57:53 +02:00

fix(nix): hc should report nix-prefetch-url as a dependency

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos Alexandro Becker 2023-06-17 23:23:14 +00:00
parent 94981fb8c0
commit c6851f5eee
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
3 changed files with 8 additions and 1 deletions

View File

@ -55,7 +55,8 @@ type Pipe struct {
prefetcher shaPrefetcher
}
func (Pipe) String() string { return "nixpkgs" }
func (Pipe) String() string { return "nixpkgs" }
func (Pipe) Dependencies(_ *context.Context) []string { return []string{"nix-prefetch-url"} }
func (p Pipe) Skip(ctx *context.Context) bool {
return len(ctx.Config.Nix) == 0 || !p.prefetcher.Available()
}

View File

@ -414,6 +414,10 @@ func TestErrNoArchivesFound(t *testing.T) {
}, "no archives found matching goos=[darwin linux] goarch=[amd64 arm arm64 386] goarm=[6 7] goamd64=v1 ids=[foo bar]")
}
func TestDependencies(t *testing.T) {
require.Equal(t, []string{"nix-prefetch-url"}, Pipe{}.Dependencies(nil))
}
type fakeNixShaPrefetcher map[string]string
func (m fakeNixShaPrefetcher) Prefetch(url string) (string, error) {

View File

@ -7,6 +7,7 @@ import (
"github.com/goreleaser/goreleaser/internal/pipe/chocolatey"
"github.com/goreleaser/goreleaser/internal/pipe/docker"
"github.com/goreleaser/goreleaser/internal/pipe/nix"
"github.com/goreleaser/goreleaser/internal/pipe/sbom"
"github.com/goreleaser/goreleaser/internal/pipe/sign"
"github.com/goreleaser/goreleaser/internal/pipe/snapcraft"
@ -32,6 +33,7 @@ var Healthcheckers = []Healthchecker{
docker.Pipe{},
docker.ManifestPipe{},
chocolatey.Pipe{},
nix.NewPublish(),
}
type system struct{}