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

Automatic download of latest release #34

Closed
ksz16 opened this issue Mar 7, 2021 · 4 comments
Closed

Automatic download of latest release #34

ksz16 opened this issue Mar 7, 2021 · 4 comments

Comments

@ksz16
Copy link

ksz16 commented Mar 7, 2021

I can get tag_name correctly from https://api.github.com/repos/dheijl/swyh-rs/releases/latest
But link https://github.com/dheijl/swyh-rs/releases/latest/download/swyh-rs-1.3.8.zip doesn't work.
It would be great if this feature worked. This makes it possible to use in scripts.

https://docs.github.com/en/github/administering-a-repository/linking-to-releases#linking-to-the-latest-release

@dheijl
Copy link
Owner

dheijl commented Mar 7, 2021

OK I put the binaries in assets now so that the links will now work.

Thanks for pointing this out to me!

@ksz16
Copy link
Author

ksz16 commented Mar 7, 2021

Thank you for your quick response.
And for all your work - swyh-rs is a great piece of software.

@ksz16
Copy link
Author

ksz16 commented Mar 7, 2021

Maybe it will be useful for someone.
Tested on Windows 7 with Cygwin installed and curl and grep added to PATH.

FOR /F "tokens=*" %%G IN ('curl -s https://api.github.com/repos/dheijl/swyh-rs/releases/latest ^| grep -oP '^"tag_name^": ^"\K^(.*^)^(^?^=^"^)'') DO set LATEST=%%G
curl -L https://github.com/dheijl/swyh-rs/releases/latest/download/swyh-rs-%LATEST%.zip -o %TEMP%\swyh-rs-%LATEST%.zip

@dheijl
Copy link
Owner

dheijl commented Mar 7, 2021

Great! I'll add this to the wiki.

@dheijl dheijl closed this as completed Mar 7, 2021
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