gen2brain / go-unarr

Go bindings for unarr (decompression library for RAR, TAR, ZIP and 7z archives)
zlib License
282 stars 44 forks source link

Bump version and add releases to github releases #15

Closed coolaj86 closed 3 years ago

coolaj86 commented 4 years ago

Two things:

1. Cross-Platform Releases Now Possible

You can now cross-build Github releases from MacOS using goreleaser (as described in the latest PR).

If you get a Github Access Token you can publish versioned builds directly to github:

git tag -a v1.0.0 -m "First CLI release"
git push origin v1.0.0

export GITHUB_TOKEN=xxxxxx
goreleaser

2. Binary name change

I'd like to add this to https://webinstall.dev as a cross-platform method of un7z.

There are already many, many, many easily available cross-platform tools, such as tar, unzip, and arc, for the "normal" package and compression formats.

There are ZERO easy-to-install cross-platform CLI tools for un7z.

  1. Would it be alright if I created a duplicate cmd/un7z/un7z.go (or replaced the existing cmd/un7z) for the purposes of making it easier to identify as the "correct" solution that people are looking for?
  2. Would you be willing (and able) to publish cross-platform binaries for un7z to github releases with goreleaser?
gen2brain commented 4 years ago
  1. Yes, thanks for the changes. I already used goreleaser before so I am familiar with how it works. I already pushed one release, the first one.

  2. I am not familiar with webinstall.dev, but sounds like a nice idea.

    1. Yes, just go ahead, cmd/un7z is ok, you can add options like --list or whatever else is possible.
    2. Sure, I have many toolchains installed, for linux/arm, arm64, ppc64le, windows/i386, amd64, darwin/amd64, all from my Linux box. I should probably update some of them but for this just compiler/toolchain is needed so no problems with that.
gen2brain commented 4 years ago

Maybe even better to just rename cmd/unarr to cmd/un7z, no need for two examples, the side effect is just that it can work with other archives as well, but so can 7zip. Btw. I have here some examples of cross-compile https://github.com/gen2brain/cam2ip/blob/master/make.bash#L3 .

Edit: I also installed x86_64-pc-linux-musl today and I tried it with goreleaser ;)

coolaj86 commented 4 years ago

Awesome! Thanks.

I'll get the updated un7z up later today (or tomorrow). (updated: or Tuesday)

Re: https://github.com/gen2brain/cam2ip/blob/master/make.bash#L3 Bookmarked. 💯

coolaj86 commented 4 years ago

Sorry I've been slow on this. I'll try to get to it today or tomorrow.

coolaj86 commented 4 years ago

It turns out that my workaround for the read error was wrong.

The unzipped 7z files are full of garbage. I tried with the unarr-test program from https://github.com/selmf/unarr and it also fails.

My un7z CLI can list files in the archive, but it cannot extract them. :-/

gen2brain commented 4 years ago

Hi, sorry, I didn't have time to check, but I had no problems with changes, so I wanted to check everything now. I had some comics and video files packed as 7z and that all worked, content was ok. Also, some files that were not possible to extract before, but after your changes worked.

Solid 7z archive is another story, so just wanted to check before I merge anything now.

coolaj86 commented 4 years ago

Perhaps it's best to not change it back then.

It seems like the read failure is difficult to interpret.

gen2brain commented 4 years ago

Yes, for now, I think I prefer to leave everything like it is. It would be nice to have more different 7z archives in testdata, older version, newer (LZMA 1/2), solid archive, etc. If we can identify the issue maybe it can be solved in selmf/unarr and then ported here, maintainer there is capable of that, I know I am not :)

I really like that un7z, looks great so far, and handles many cases, very nice addition.

gen2brain commented 4 years ago

Maybe also to have something else in test archives, like some jpeg file, so also decode image can be tested, the text file is probably not the best case to test.