mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-02-03 13:11:48 +02:00
feat: allow to use .tar as archive format
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
parent
8858049a28
commit
990fb63aef
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
|
1
pkg/archive/testdata/badlink.txt
vendored
Symbolic link
1
pkg/archive/testdata/badlink.txt
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
regular3.txt
|
1
pkg/archive/testdata/regular.txt
vendored
1
pkg/archive/testdata/regular.txt
vendored
@ -0,0 +1 @@
|
||||
regular file
|
@ -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`.
|
||||
|
Loading…
x
Reference in New Issue
Block a user