diff --git a/pkg/archive/archive.go b/pkg/archive/archive.go index 2bcac9e78..9da00b1d2 100644 --- a/pkg/archive/archive.go +++ b/pkg/archive/archive.go @@ -6,6 +6,7 @@ import ( "strings" "github.com/goreleaser/goreleaser/pkg/archive/gzip" + "github.com/goreleaser/goreleaser/pkg/archive/tar" "github.com/goreleaser/goreleaser/pkg/archive/targz" "github.com/goreleaser/goreleaser/pkg/archive/tarxz" "github.com/goreleaser/goreleaser/pkg/archive/zip" @@ -32,5 +33,8 @@ func New(file *os.File) Archive { if strings.HasSuffix(file.Name(), ".zip") { return zip.New(file) } + if strings.HasSuffix(file.Name(), ".tar") { + return tar.New(file) + } return targz.New(file) } diff --git a/pkg/archive/archive_test.go b/pkg/archive/archive_test.go index feb2aebe6..6de1a02a4 100644 --- a/pkg/archive/archive_test.go +++ b/pkg/archive/archive_test.go @@ -15,7 +15,7 @@ func TestArchive(t *testing.T) { require.NoError(t, empty.Close()) require.NoError(t, os.Mkdir(folder+"/folder-inside", 0o755)) - for _, format := range []string{"tar.gz", "zip", "gz", "tar.xz", "willbeatargzanyway"} { + for _, format := range []string{"tar.gz", "zip", "gz", "tar.xz", "tar", "willbeatargzanyway"} { format := format t.Run(format, func(t *testing.T) { file, err := os.Create(folder + "/folder." + format) diff --git a/pkg/archive/testdata/badlink.txt b/pkg/archive/testdata/badlink.txt new file mode 120000 index 000000000..35b629a15 --- /dev/null +++ b/pkg/archive/testdata/badlink.txt @@ -0,0 +1 @@ +regular3.txt \ No newline at end of file diff --git a/pkg/archive/testdata/regular.txt b/pkg/archive/testdata/regular.txt index e69de29bb..fa4665e97 100644 --- a/pkg/archive/testdata/regular.txt +++ b/pkg/archive/testdata/regular.txt @@ -0,0 +1 @@ +regular file diff --git a/www/docs/customization/archive.md b/www/docs/customization/archive.md index ea3fcf38b..6da7aef8a 100644 --- a/www/docs/customization/archive.md +++ b/www/docs/customization/archive.md @@ -20,7 +20,7 @@ archives: builds: - default - # Archive format. Valid options are `tar.gz`, `tar.xz`, `gz`, `zip` and `binary`. + # Archive format. Valid options are `tar.gz`, `tar.xz`, `tar`, `gz`, `zip` and `binary`. # If format is `binary`, no archives are created and the binaries are instead # uploaded directly. # Default is `tar.gz`.