Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically detect the SRTOOL version to use #105

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions scripts/build-tracing-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,32 @@ ALL_RUNTIMES_NAMES=(
moonriver
moonbeam
)
SRTOOL_IMAGE="paritytech/srtool:1.77.0"


# Arguments
VERSION=$1
RUNTIME_NAME_FILTER=${2:-"[a-z]"}
CARGO_BUILD_JOBS=${3:-"8"}

# Download srtool image
docker pull $SRTOOL_IMAGE

# Copy the needed source code in a temporary folder
mkdir -p tmp/build/tracing
cp -r tracing/${VERSION} tmp/build/tracing/${VERSION}
cp -r tracing/shared tmp/build/tracing/${VERSION}/shared
cd tmp/build/tracing/${VERSION}
chmod -R 777 runtime


# get the toolchain rust version
RUST_VERSION=$(cat rust-toolchain | grep channel | grep --only-matching --perl-regexp "(\d+\.){2}\d+")
# if the version is empty, default to 1.69.0 (that is for runtime before 2300)
if [ -z "$RUST_VERSION" ]; then
RUST_VERSION="1.69.0"
fi
SRTOOL_IMAGE="paritytech/srtool:$RUST_VERSION"

# Download srtool image
docker pull $SRTOOL_IMAGE

for RUNTIME_NAME in ${ALL_RUNTIMES_NAMES[@]}; do
RUNTIME_DIR="runtime/$RUNTIME_NAME"
if [[ "$RUNTIME_NAME" =~ $RUNTIME_NAME_FILTER ]]; then
Expand Down
Loading