From 6585e6672fa0fab8599d4db6f48e34df33859b19 Mon Sep 17 00:00:00 2001 From: Kerim Djiho Date: Mon, 29 Apr 2019 14:41:44 +0200 Subject: [PATCH] Updated the magefile.go to use new version of archiver library --- magefile.go | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/magefile.go b/magefile.go index 793b86b7..2eadaa47 100644 --- a/magefile.go +++ b/magefile.go @@ -587,13 +587,30 @@ func Release() error { if platform.OS == "windows" { // build a zip binary as well - err := archiver.Zip.Make(fmt.Sprintf("%s.zip", platform.ReleaseBase()), []string{platform.ArchiveDir()}) + + // creates a Zip configuration + z := archiver.Zip{ + CompressionLevel: 3, + MkdirAll: true, + SelectiveCompression: true, + ContinueOnError: false, + OverwriteExisting: false, + ImplicitTopLevelFolder: false, + } + + err := z.Archive([]string{platform.ArchiveDir()}, fmt.Sprintf("%s.zip", platform.ReleaseBase())) if err != nil { return err } } // build tar gz - err := archiver.TarGz.Make(fmt.Sprintf("%s.tar.gz", platform.ReleaseBase()), []string{platform.ArchiveDir()}) + + //creates TarGz configuration + t := archiver.TarGz{ + CompressionLevel: 3, + } + + err := t.Archive([]string{platform.ArchiveDir()}, fmt.Sprintf("%s.tar.gz", platform.ReleaseBase())) if err != nil { return err }