-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rln-relay): fetch release from zerokit ci, or build (#1603)
* feat(rln-relay): fetch release from zerokit ci, or build * fix(build_rln): shellcheck, move to scripts dir
- Loading branch information
Showing
3 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script is used to build the rln library for the current platform, or download it from the | ||
# release page if it is available. | ||
|
||
set -e | ||
|
||
# first argument is the build directory | ||
build_dir=$1 | ||
|
||
if [[ -z "$build_dir" ]]; then | ||
echo "No build directory specified" | ||
exit 1 | ||
fi | ||
|
||
# Get the host triplet | ||
host_triplet=$(rustup show | grep "Default host: " | cut -d' ' -f3) | ||
|
||
# Download the prebuilt rln library if it is available | ||
if curl --silent --fail-with-body -L "https://github.com/vacp2p/zerokit/releases/download/nightly/$host_triplet-rln.tar.gz" >> "$host_triplet-rln.tar.gz" | ||
then | ||
echo "Downloaded $host_triplet-rln.tar.gz" | ||
tar -xzf "$host_triplet-rln.tar.gz" | ||
mv release/librln.a . | ||
rm -rf "$host_triplet-rln.tar.gz" release | ||
else | ||
echo "Failed to download $host_triplet-rln.tar.gz" | ||
# Build rln instead | ||
cargo build --release --manifest-path "$build_dir/rln/Cargo.toml" | ||
cp "$build_dir/rln/target/release/librln.a" . | ||
fi |