From b0f46ac979f0f752f8066be34ad19e32a95a92c0 Mon Sep 17 00:00:00 2001 From: Kerber0x Date: Tue, 16 Jan 2024 17:28:08 +0000 Subject: [PATCH] ci: make release script add osmosis flag if needed --- scripts/build_release.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/build_release.sh b/scripts/build_release.sh index cd2fabbe..498a2d81 100755 --- a/scripts/build_release.sh +++ b/scripts/build_release.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash set -e +projectRootPath=$(realpath "$0" | sed 's|\(.*\)/.*|\1|' | cd ../ | pwd) + # Displays tool usage function display_usage() { echo "Release builder" @@ -33,6 +35,18 @@ case $chain in osmosis) flag="-osmosis" + echo " $projectRootPath/Cargo.toml" + + # backup the Cargo.toml file + cp $projectRootPath/Cargo.toml $projectRootPath/Cargo.toml.bak + + # add the osmosis feature flag to the Cargo.toml file so it optimizes correctly + if [[ "$(uname)" == "Darwin" ]]; then + sed -i '' '/white-whale =/ s/features = \[\]/features = \["osmosis"\]/' $projectRootPath/Cargo.toml + else + sed -i '/white-whale =/ s/features = \[\]/features = \["osmosis"\]/' $projectRootPath/Cargo.toml + fi + ;; juno | terra | chihuahua) flag="-osmosis_token_factory" @@ -84,3 +98,8 @@ $projectRootPath/scripts/check_artifacts_size.sh # Check generated wasm file sizes $projectRootPath/scripts/get_artifacts_versions.sh + +if [[ "$chain" == "osmosis" ]]; then + #if the chain is osmosis, restore the Cargo.toml file + mv $projectRootPath/Cargo.toml.bak $projectRootPath/Cargo.toml +fi