mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-02-03 13:11:48 +02:00
fix: archive check when project is a library
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
parent
4471154461
commit
229c8f54a5
@ -119,7 +119,7 @@ func checkArtifacts(artifacts map[string][]*artifact.Artifact) error {
|
||||
for _, v := range artifacts {
|
||||
lens[len(v)] = true
|
||||
}
|
||||
if len(lens) == 1 {
|
||||
if len(lens) <= 1 {
|
||||
return nil
|
||||
}
|
||||
return ErrArchiveDifferentBinaryCount
|
||||
|
@ -244,6 +244,21 @@ func TestRunPipeDifferentBinaryCount(t *testing.T) {
|
||||
require.EqualError(t, Pipe{}.Run(ctx), "invalid archive: 0: "+ErrArchiveDifferentBinaryCount.Error())
|
||||
}
|
||||
|
||||
func TestRunPipeNoBinaries(t *testing.T) {
|
||||
folder, back := testlib.Mktmp(t)
|
||||
defer back()
|
||||
var dist = filepath.Join(folder, "dist")
|
||||
require.NoError(t, os.Mkdir(dist, 0755))
|
||||
var ctx = context.New(config.Project{
|
||||
Dist: dist,
|
||||
ProjectName: "foobar",
|
||||
Archives: []config.Archive{{}},
|
||||
})
|
||||
ctx.Version = "0.0.1"
|
||||
ctx.Git.CurrentTag = "v0.0.1"
|
||||
require.NoError(t, Pipe{}.Run(ctx))
|
||||
}
|
||||
|
||||
func zipFiles(t *testing.T, path string) []string {
|
||||
f, err := os.Open(path)
|
||||
require.NoError(t, err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user