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

GH release naming convention - Remove version from asset name #211

Closed
polarathene opened this issue Sep 14, 2024 · 2 comments
Closed

GH release naming convention - Remove version from asset name #211

polarathene opened this issue Sep 14, 2024 · 2 comments

Comments

@polarathene
Copy link

As you're approaching a new breaking change release with the 2.0 release, now is a good time to consider improving how the assets are named? (more details)

Presently if I download the asset it's like this:

$ wget -q https://github.com/01mf02/jaq/releases/download/v2.0.0-alpha.1/jaq-v2.0.0-alpha.1-x86_64-unknown-linux-musl

$ ls -l jaq*
-rw-r--r-- 1 root root 1412456 Sep  2 14:21 jaq-v2.0.0-alpha.1-x86_64-unknown-linux-musl
  • I usually see tar.gz archives (or .zip for windows) which allows preserving file attributes like the executable bit +x (not always ideal though, as the linked issue points out).
  • I can understand wanting to avoid a compressed archive (which should ideally vary by platform, see goreleaser config example as a way to support that), running chmod +x afterwards resolves the executable concern anyway 👍

I think a better convention is to keep the tag in the URL and leave it out of the asset name? That would allow:

# `-o` to rename to something nicer, and places at a location in `PATH` ENV
curl -fsSL -o /usr/local/bin/jaq "https://github.com/01mf02/jaq/releases/latest/download/jaq-$(uname -m)-unknown-linux-musl"
chmod +x /usr/local/bin/jaq

One benefit from an archive would be that the full target is separate from the binary name, so in addition to preserving +x I could just use:

# `-C /usr/local/bin` only needed to place the `jaq` binary there
# NOTE: The ownership from CI will be preserved as `1001:127`,
# so technically `--no-same-owner` is required for tar too (doesn't seem to be a common issue though)
curl -fsSL "https://github.com/01mf02/jaq/releases/latest/download/jaq-$(uname -m)-unknown-linux-musl.tar.gz" \
  | tar -xz -C /usr/local/bin

But if that adds some friction to users that aren't using CLI and would prefer the asset without the archive layer, no worries.

I just wanted to point out the benefit of omitting the version from the asset name 😎 (which could add a new example to the README for linux)

@01mf02
Copy link
Owner

01mf02 commented Sep 16, 2024

I like the idea of omitting the version number, so future releases should have the shape that you proposed (see babc05c).
I also like the idea of adding a new example to the README, I hope that I'll remember to put it up once 2.0 is out.

However, I'll stick without archives for now, because it's easier for users, I think.

@01mf02
Copy link
Owner

01mf02 commented Nov 28, 2024

I added download instructions in ac45dd9.

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

2 participants