Skip to content

Commit

Permalink
feat: download release tarball from named release
Browse files Browse the repository at this point in the history
Avoid the need for using the commit hash to find the release.

Fixes: #491
  • Loading branch information
rvagg committed Sep 18, 2024
1 parent 2a04411 commit 48e90e5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions install-filcrypto
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,16 @@ download_release_tarball() {
local __rust_sources_path=$2
local __repo_name=$3
local __release_flags=$4
local __release_sha1=$(git rev-parse HEAD)
local __release_tag="${__release_sha1:0:16}"
local __release_tags=$(git tag --points-at "$(git rev-parse HEAD)")
local __release_tag=$(echo "${__release_tags}" | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-\w+)?$' | head -n 1)

# If we're building from a commit that doesn't have a tag, we need to
# compile from source.
if [ -z "${__release_tag}" ]; then
(>&2 echo "[download_release_tarball] failed to determine release tag")
return 1
fi

local __release_tag_url="https://api.github.com/repos/filecoin-project/${__repo_name}/releases/tags/${__release_tag}"

# Download the non-optimized standard release.
Expand Down

0 comments on commit 48e90e5

Please sign in to comment.