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

Download Latest Release #74

Closed
markfaine opened this issue Oct 2, 2022 · 6 comments
Closed

Download Latest Release #74

markfaine opened this issue Oct 2, 2022 · 6 comments
Labels
improvement New feature or request wontfix This will not be worked on

Comments

@markfaine
Copy link

Can you add a latest tag or symlink it in some way? The use case is downloading the newest version from CLI without knowing the version number of the latest version. There may already be a way to do this but I can't figure it out if there is.
Thank you

@markfaine markfaine added the improvement New feature or request label Oct 2, 2022
@markfaine markfaine changed the title [FEATURE] Download Latest Release Oct 2, 2022
@arl
Copy link
Owner

arl commented Oct 4, 2022

Hi @markfaine.
There's no one liner to do that unfortunately, since the version number is part of the file name to download.

You'd probably have to use GitHub API or maybe just simply list git tags on the repo and forge the filename you want to download based on the latest tag.

What's your use case? I'm curious

@markfaine
Copy link
Author

Ansible role for setting up my development environment. Nothing too important :) I was trying to use 'latest' as the default but also allow setting a variable for a specific version. It seems like such an obvious need, I'm surprised github doesn't already have a way to do it.

@arl
Copy link
Owner

arl commented Jan 16, 2023

For reference, it doesn't seen like that is something one can do without some script-fu or additional tools.
More info there https://gist.github.com/steinwaywhw/a4cd19cda655b8249d908261a62687f8

@arl arl added the wontfix This will not be worked on label Feb 18, 2023
@arl
Copy link
Owner

arl commented Feb 18, 2023

Closing as wontfix since github doesn't support that at the moment.

@arl
Copy link
Owner

arl commented Jun 9, 2024

fyi see #104

@markfaine
Copy link
Author

Thanks @arl

This works:

repo="https://api.github.com/repos/arl/gitmux/releases/latest" 
wget -q -O - "$repo"  \
 | jq -r '.assets[] | select(.name | contains("linux_amd64")).browser_download_url'

You can also replace "linux_amd64" with whatever architecture or use a variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants