You can use download-workflow-artifact action.
Hoe to download release artifacts through curl
Download an artifact from the command line?
download - Is there a link to GitHub for downloading a file in the latest release of a repository? - Stack Overflow
deployment - Is there a way to download an artifact from the latest release on GitHub? - Stack Overflow
Videos
You can use download-workflow-artifact action.
One of my team mates got this working:
- id: download-release-asset
name: Download release asset
uses: dsaltares/fetch-gh-release-asset@master
with:
version: tags/${{ env.RELEASE }}
file: myproject-${{ env.RELEASE }}.tar.gz
target: release.tar.gz
token: ${{ secrets.DEPLOY_TOKEN }}
I tried to download the release artifact using curl
curl -o ~/demo.jar https://github.com/org/repo/releases/download/v0.2/demo-0.2.jar
File downloaded but when I checked the file size it's not correct, less than Kb. Actual file size is in Mb
Not sure if my url in the curl command is apt in this scenario. Any pointers would help.
A few years late, but I just implemented a simple redirect to support https://github.com/USER/PROJECT/releases/latest/download/package.zip. That should redirected to the latest tagged package.zip release asset. Hope it's handy!
Linux solution to get latest release asset download link (works only if release has one asset only)
curl -s https://api.github.com/repos/boxbilling/boxbilling/releases/latest | grep browser_download_url | cut -d '"' -f 4
You can use the GitHub API.
To download a release using wget, you can do:
wget --header "Authorization: token <GITHUB TOKEN>" --output-document=<RELEASE>.tar.gz https://api.github.com/repos/<USER>/<REPO>/tarball/<RELEASE NAME>
Use can change tarball to zipball to get a zip file.
The release.tar.gz part is set by the owner, so it is not generic.
$ wget https://github.com/XhmikosR/notepad2-mod/releases/download/4.2.25.935/Notepad2-mod.4.2.25.935.exe --2014-12-02 11:16:42-- https://github.com/XhmikosR/notepad2-mod/releases/download/4.2.25.935/Notepad2-mod.4.2.25.935.exe Resolving github.com (github.com)... 192.30.252.130 Connecting to github.com (github.com)|192.30.252.130|:443... connected. HTTP request sent, awaiting response... 302 Found