cycles-quartz/scripts/build-contract.sh
hu55a1n1 be68105ec5 repo reorg
Move utils/quartz-proto to core/quartz-proto

Fix Cargo.toml paths

Add default working-directory for cosmwasm CI jobs

Fix default working-directory

Rename .cargo/config -> config.toml

Update working-directory

Update cosmwasm workflows

Update rust.yml paths

Add aliases to cargo config.toml

Test working-directory

Update cosmwasm CI jobs

Use --manifest-path

Use dtolnay/rust-toolchain action

Fix workflow

Remove --locked

SSH agent

SSH agent for schema

Remove unused SSH key

Exclude cw-tee-mtcs from rust CI jobs

Clippy fix

cargo fmt

Add CONTRIBUTING.md

Update README.md
2024-05-21 03:26:41 -07:00

24 lines
759 B
Bash
Executable file

#!/bin/bash
# Build and optimize the contract to output a WASM binary that can be deployed to a CosmWasm chain.
set -euo pipefail
if ! [ -f "Cargo.toml" ]; then
echo "❌ Error: Cannot find 'Cargo.toml' in current directory. Make sure this command is run from the contract's source directory"
exit 1
fi
echo "👷 Building and optimizing the contract..."
echo "==========================================="
RUSTFLAGS='-C link-arg=-s' cargo wasm
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.15.0
echo ""
echo "🎉 Contract build and optimization completed successfully!"