Last active
February 23, 2024 13:15
-
-
Save Integralist/0a685f3128597a18107ced7367b8a5bd to your computer and use it in GitHub Desktop.
[Download latest GitHub Asset Release] #github #asset #release
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: bin-viceroy | |
bin-viceroy: # Download latest version of Viceroy to ./bin/ directory | |
@arch=$$(uname -m | sed 's/x86_64/amd64/'); \ | |
os=$$(uname -s | tr '[:upper:]' '[:lower:]'); \ | |
url=$$(curl -s https://api.github.com/repos/fastly/viceroy/releases/latest | jq --arg arch $$arch --arg os $$os -r '.assets[] | select((.name | contains($$arch)) and (.name | contains($$os))) | .browser_download_url'); \ | |
filename=$$(basename $$url); \ | |
curl -sLO $$url && mkdir -p bin && tar -xzvf $$filename --directory ./bin/ && \ | |
./bin/viceroy --version && rm $$filename && sudo cp ./bin/viceroy /usr/local/bin/viceroy # NOTE: sudo is a no-op in GitHub Actions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment