Skip to content

Commit

Permalink
replace soroban-cli with stellar-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
hawthorne-abendsen committed Jun 24, 2024
1 parent 04f4f5c commit 8620e9a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
description: 'Name for the release'
required: true
type: string
soroban_cli_version:
description: 'Soroban CLI version'
stellar_cli_version:
description: 'Stellar CLI version'
required: false
type: string
rust_version:
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
context: ./docker
push: true
build-args: |
SOROBAN_CLI_VERSION=${{ inputs.soroban_cli_version }}
STELLAR_CLI_VERSION=${{ inputs.stellar_cli_version }}
RUST_VERSION=${{ inputs.rust_version }}
tags: |
ghcr.io/${{ github.repository }}:${{ github.sha }}
Expand Down
16 changes: 8 additions & 8 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ RUN if [ "$RUST_VERSION" ]; then \
# Install the wasm32-unknown-unknown target
RUN rustup target add wasm32-unknown-unknown

# Define the version argument for soroban-cli with a default value
ARG SOROBAN_CLI_VERSION=""
# Define the version argument for stellar-cli with a default value
ARG STELLAR_CLI_VERSION=""

# Install soroban-cli
RUN if [ -z "$SOROBAN_CLI_VERSION" ]; then \
cargo install --locked soroban-cli --features opt; \
# Install stellar-cli
RUN if [ -z "$STELLAR_CLI_VERSION" ]; then \
cargo install --locked stellar-cli --features opt; \
else \
cargo install --locked soroban-cli --features opt --version $SOROBAN_CLI_VERSION; \
cargo install --locked stellar-cli --features opt --version $STELLAR_CLI_VERSION; \
fi

# Print the version of rustc
Expand All @@ -47,8 +47,8 @@ RUN rustc --version
# Print the version of cargo
RUN cargo --version

# Print the version of soroban-cli
RUN soroban --version
# Print the version of stellar-cli
RUN stellar --version

# Specify the package to build
ENV PACKAGE=${PACKAGE}
Expand Down
12 changes: 6 additions & 6 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ rustc --version
# Print Cargo version
cargo --version

# Print Soroban version
soroban --version
# Print Stellar version
stellar --version

# Check if the Cargo.toml file exists
if [ ! -f "Cargo.toml" ]; then
Expand All @@ -59,13 +59,13 @@ fi

# Check if the PACKAGE is defined add it to the build command
if [ "$PACKAGE" ]; then
soroban contract build --package $PACKAGE --out-dir ${OUTPUT}
stellar contract build --package $PACKAGE --out-dir ${OUTPUT}
# Set the package name to the provided package name
PACKAGE_NAME=$PACKAGE
else
# Get the package name from the Cargo.toml file
PACKAGE_NAME=$(grep -m1 '^name =' Cargo.toml | cut -d '"' -f2)
soroban contract build --out-dir ${OUTPUT}
stellar contract build --out-dir ${OUTPUT}
fi

# Verify that the build was successful
Expand Down Expand Up @@ -118,7 +118,7 @@ fi
cd ${RELEASE_DIR}

# Optimize the WASM file
soroban contract optimize --wasm ${WASM_FILE_NAME} --wasm-out ${WASM_FILE_NAME}
stellar contract optimize --wasm ${WASM_FILE_NAME} --wasm-out ${WASM_FILE_NAME}

# Verify that the optimized.wasm file exists
if [ ! -f "${RELEASE_DIR}/${WASM_FILE_NAME}" ]; then
Expand All @@ -127,7 +127,7 @@ if [ ! -f "${RELEASE_DIR}/${WASM_FILE_NAME}" ]; then
fi

# Get the CLI version
CLI_VERSION=$(soroban --version | grep -oP 'soroban \K\S+')
CLI_VERSION=$(stellar --version | grep -oP 'stellar \K\S+')

# Calculate the SHA256 hash of the wasm file
WASM_FILE_SHA256=$(sha256sum $WASM_FILE_NAME | cut -d ' ' -f 1)
Expand Down

0 comments on commit 8620e9a

Please sign in to comment.