You've already forked goreleaser
							
							
				mirror of
				https://github.com/goreleaser/goreleaser.git
				synced 2025-10-30 23:58:09 +02:00 
			
		
		
		
	fix: archive check when project is a library
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
		| @@ -119,7 +119,7 @@ func checkArtifacts(artifacts map[string][]*artifact.Artifact) error { | |||||||
| 	for _, v := range artifacts { | 	for _, v := range artifacts { | ||||||
| 		lens[len(v)] = true | 		lens[len(v)] = true | ||||||
| 	} | 	} | ||||||
| 	if len(lens) == 1 { | 	if len(lens) <= 1 { | ||||||
| 		return nil | 		return nil | ||||||
| 	} | 	} | ||||||
| 	return ErrArchiveDifferentBinaryCount | 	return ErrArchiveDifferentBinaryCount | ||||||
|   | |||||||
| @@ -244,6 +244,21 @@ func TestRunPipeDifferentBinaryCount(t *testing.T) { | |||||||
| 	require.EqualError(t, Pipe{}.Run(ctx), "invalid archive: 0: "+ErrArchiveDifferentBinaryCount.Error()) | 	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 { | func zipFiles(t *testing.T, path string) []string { | ||||||
| 	f, err := os.Open(path) | 	f, err := os.Open(path) | ||||||
| 	require.NoError(t, err) | 	require.NoError(t, err) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user