dist: add version and book (#1965)

This commit is contained in:
Ștefan Talpalaru 2020-11-06 17:26:03 +01:00 committed by GitHub
parent bd169732c8
commit f3254fd754
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 10 deletions

View File

@ -2,7 +2,7 @@
This binary distribution was created from https://github.com/status-im/nimbus-eth2
Tarball naming scheme: "nimbus-eth2\_Linux\_amd64\_<GIT COMMIT>\_<YYYYMMDDHHMMSS>.tar.gz" (the date is in UTC).
Tarball naming scheme: "nimbus-eth2\_Linux\_amd64\_<VERSION>\_<GIT COMMIT>\_<YYYYMMDDHHMMSS>.tar.gz" (the date is in UTC).
## Reproducing the build

View File

@ -4,20 +4,24 @@ set -e
cd /home/user/nimbus-eth2
PREFIX="nimbus-eth2_Linux_amd64_"
GIT_COMMIT="$(git rev-parse --short HEAD)"
DIR="${PREFIX}${GIT_COMMIT}_$(date --utc +'%Y%m%d%H%M%S')"
DIST_PATH="dist/${DIR}"
BINARIES="beacon_node medalla_beacon_node"
# delete old artefacts
rm -rf "dist/${PREFIX}"*.tar.gz
mkdir -p "${DIST_PATH}"
# we need to build everything against libraries available inside this container, including the Nim compiler
make clean
make -j$(nproc) LOG_LEVEL="TRACE" NIMFLAGS="-d:disableMarchNative" PARTIAL_STATIC_LINKING=1 ${BINARIES}
# archive directory (we need the Nim compiler in here)
PREFIX="nimbus-eth2_Linux_amd64_"
GIT_COMMIT="$(git rev-parse --short HEAD)"
VERSION="$(./env.sh nim --verbosity:0 --hints:off --warnings:off scripts/print_version.nims)"
TIMESTAMP="$(date --utc +'%Y%m%d%H%M%S')"
DIR="${PREFIX}${VERSION}_${GIT_COMMIT}_${TIMESTAMP}"
DIST_PATH="dist/${DIR}"
# delete old artefacts
rm -rf "dist/${PREFIX}"*.tar.gz
mkdir -p "${DIST_PATH}"
# copy and checksum binaries, copy scripts and docs
for BINARY in ${BINARIES}; do
cp -a ./build/${BINARY} "${DIST_PATH}/"
cd "${DIST_PATH}"
@ -27,6 +31,7 @@ for BINARY in ${BINARIES}; do
done
sed -e "s/GIT_COMMIT/${GIT_COMMIT}/" docker/dist/README.md > "${DIST_PATH}/README.md"
cp -a scripts/makedir.sh docker/dist/run_medalla_node.sh "${DIST_PATH}/"
cp -a docs/the_nimbus_book "${DIST_PATH}/"
# create the tarball
cd dist

View File

@ -0,0 +1,4 @@
import ../beacon_chain/version
echo versionAsStr