LBNL-ETA/Radiance latest release


I am trying to set up an automated build of a docker container and I am looking for a way to programmatically get the latest release from the github repository so I can download the precompiled binaries. The goal is to do this:

unzip Radiance_* 
tar -xzf radiance-*-Linux.tar.gz 

where LATEST would be programattically assigned. I don’t otherwise ned to clone the repository and besides I don’t think I can get this information from git as something like:

git ls-remote --tags origin

does not sort by date and the tags are otherwise unordered. A quick google suggests I can do this with the github api, but before I go down that path I thought I would see if anyone has already done something similar, or since I think this repository is mostly automated if there would be an easy way to add a “latest” tag to the build process so that this url:

https:// /LBNL-ETA/Radiance/releases/download/latest/

would always work.


I found a reasonable solution that seems to work using a sparse/partial clone:

mkdir build
mkdir radiance
cd build
git clone --sparse --filter=blob:none --no-checkout
cd Radiance
export RADVERSION=$(git ls-remote --sort=committerdate --tags | tail -1 | sed -n -e 's/^.*\///p')
cd ..
unzip Radiance_* 
tar -xzf radiance-*-Linux.tar.gz 
cd ../radiance
rm -rf bin lib man
mv ../build/radiance-*-Linux/usr/local/radiance/* ./
rm -rf ../build

I’ll check it a few times as the next few releases drop

Hi Stephen,

Indeed you can do this with GitHub api. It seems this might work:
curl -s\?per_page\=1 | grep "browser_download_url.*" | cut -d: -f2,3 | tr -d \" | wget -

With their command line tool gh, this should also work:
ver=$(gh release list -R LBNL-ETA/Radiance -L 1 | cut -f 3)
gh release download $ver -R LBNL-ETA/Radiance -p '*'

1 Like

Hi Taoning,

Thanks, this is perfect!

One small edit: at least on macos and my linux systems wget needs to be: wget -i -