create and publish github release (#1216)
* create and publish github release * creates a tarball of 'lotus', 'lotus-storage-miner' and 'lotus-seal-worker' for darwin and linux * computes and saves IPFS CID and sha512sum for each architecture * creates a github release and uploads all artifacts * triggered by tags matching regex /^v\d+\.\d+\.\d+$/ ie. v0.1.0 * add licenses and readme
This commit is contained in:
Executable
+52
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
|
||||
ARCHS=(
|
||||
"darwin"
|
||||
"linux"
|
||||
)
|
||||
|
||||
REQUIRED=(
|
||||
"ipfs"
|
||||
"sha512sum"
|
||||
)
|
||||
for REQUIRE in "${REQUIRED[@]}"
|
||||
do
|
||||
command -v "${REQUIRE}" >/dev/null 2>&1 || echo >&2 "'${REQUIRE}' must be installed"
|
||||
done
|
||||
|
||||
mkdir bundle
|
||||
pushd bundle
|
||||
|
||||
BINARIES=(
|
||||
"lotus"
|
||||
"lotus-storage-miner"
|
||||
"lotus-seal-worker"
|
||||
)
|
||||
|
||||
export IPFS_PATH=`mktemp -d`
|
||||
ipfs init
|
||||
ipfs daemon &
|
||||
PID="$!"
|
||||
trap "kill -9 ${PID}" EXIT
|
||||
sleep 30
|
||||
|
||||
for ARCH in "${ARCHS[@]}"
|
||||
do
|
||||
mkdir -p "${ARCH}/lotus"
|
||||
pushd "${ARCH}"
|
||||
for BINARY in "${BINARIES[@]}"
|
||||
do
|
||||
cp "../../${ARCH}/${BINARY}" "lotus/"
|
||||
chmod +x "lotus/${BINARY}"
|
||||
done
|
||||
|
||||
tar -zcvf "../lotus_${CIRCLE_TAG}_${ARCH}-amd64.tar.gz" lotus
|
||||
popd
|
||||
rm -rf "${ARCH}"
|
||||
|
||||
sha512sum "lotus_${CIRCLE_TAG}_${ARCH}-amd64.tar.gz" | cut -d" " -f1 > "lotus_${CIRCLE_TAG}_${ARCH}-amd64.tar.gz.sha512"
|
||||
|
||||
ipfs add "lotus_${CIRCLE_TAG}_${ARCH}-amd64.tar.gz" | cut -d" " -f2 > "lotus_${CIRCLE_TAG}_${ARCH}-amd64.tar.gz.cid"
|
||||
done
|
||||
popd
|
||||
Reference in New Issue
Block a user