set lazy
latest := `curl -s https://api.github.com/repos/arp242/goatcounter/releases/latest | grep -o '"tag_name": "[^"]*' | cut -d'"' -f4`
current := `cat artifacts/goatcounter.version 2>/dev/null || true`
# Download goatcounter, unless we already have the latest release
prepare-artifacts:
{{ if latest == current { "echo goatcounter " + latest + " already up to date" } else { "just _download " + latest } }}
[private]
_download tag:
mkdir -p artifacts
curl -sL "https://github.com/arp242/goatcounter/releases/download/{{tag}}/goatcounter-{{tag}}-linux-amd64.gz" | gunzip > artifacts/goatcounter
chmod +x artifacts/goatcounter
echo "{{tag}}" > artifacts/goatcounter.version