Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request: consider releasing tar.gz archives for non-Windows systems #448

Open
hhromic opened this issue Aug 25, 2023 · 0 comments
Open

request: consider releasing tar.gz archives for non-Windows systems #448

hhromic opened this issue Aug 25, 2023 · 0 comments

Comments

@hhromic
Copy link

hhromic commented Aug 25, 2023

First of all, thanks for this very useful tool. 💯

I noticed that the release artifacts for go-getter are formatted as ZIP files (for example for 1.7.2):

go-getter_1.7.2_darwin_amd64.zip
go-getter_1.7.2_linux_386.zip
go-getter_1.7.2_linux_amd64.zip
go-getter_1.7.2_windows_386.zip
go-getter_1.7.2_windows_amd64.zip

While ZIP is a widely known and used archiving format, it is not very convenient in non-Windows systems where the unzip command may not even be installed by default. For systems such as Linux and macOS, the defacto standard archiving tool is tar and for compression is gzip or even bzip2. For this reason, many software archives are usually distributed in tar.gz or tar.bz2 formats.

Would go-getter consider releasing archives in tar.gz (more widely used) or tar.bz2 formats for Linux and macOS?

This is actually very easy to accomplish with goreleaser, which is the releasing tool seemingly used in this repository.

Currently, go-getter uses the following goreleaser configuration which generates the ZIP files for everything:

archives:
  - format: zip
    name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
    files: 
      - none*

From the official documentation of goreleaser it can be seen that using tar.gz for non-Windows and ZIP for Windows systems is rather trivial and even documented as a common use case:

archives:
    # Archive format. Valid options are `tar.gz`, `tgz`, `tar.xz`, `txz`, tar`, `gz`, `zip` and `binary`.
    # If format is `binary`, no archives are created and the binaries are instead
    # uploaded directly.
    #
    # Default: 'tar.gz'
    format: tar.gz

    # Can be used to change the archive formats for specific GOOSs.
    # Most common use case is to archive as zip on Windows.
    format_overrides:
      - goos: windows
        format: zip

    # The rest used by go-getter
    name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
    files: 
      - none*

With non-Windows releases in tar.gz format, this pattern can be used for installing go-getter for example inside a container:

mkdir -p /opt/go-getter
curl -L https://github.com/hashicorp/go-getter/releases/download/v1.7.2/go-getter_1.7.2_linux_amd64.tar.gz \
    | tar zxf - -C /opt/go-getter

Currently, with the ZIP format archives, it is required to install additional tools and create temporary files and boilerplate code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant