From 082dac9e995214dba5bb5e2e3f364fbe72513685 Mon Sep 17 00:00:00 2001 From: Nando Vieira Date: Thu, 30 May 2024 16:02:36 -0700 Subject: [PATCH 1/3] Update other references to stellar-cli. (#1349) --- FULL_HELP_DOCS.md | 2 +- cmd/soroban-cli/Cargo.toml | 4 ++-- cmd/soroban-cli/src/commands/mod.rs | 2 +- cmd/stellar-cli/Cargo.toml | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/FULL_HELP_DOCS.md b/FULL_HELP_DOCS.md index c23eaf76c..8fecf7d73 100644 --- a/FULL_HELP_DOCS.md +++ b/FULL_HELP_DOCS.md @@ -63,7 +63,7 @@ This document contains the help content for the `stellar` command-line program. Build, deploy, & interact with contracts; set identities to sign with; configure networks; generate keys; and more. Stellar Docs: https://developers.stellar.org -CLI Full Hep Docs: https://github.com/stellar/soroban-cli/tree/main/FULL_HELP_DOCS.md +CLI Full Hep Docs: https://github.com/stellar/stellar-cli/tree/main/FULL_HELP_DOCS.md The easiest way to get started is to generate a new identity: diff --git a/cmd/soroban-cli/Cargo.toml b/cmd/soroban-cli/Cargo.toml index 986f69517..c0142e1e6 100644 --- a/cmd/soroban-cli/Cargo.toml +++ b/cmd/soroban-cli/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "soroban-cli" description = "Soroban CLI" -homepage = "https://github.com/stellar/soroban-cli" -repository = "https://github.com/stellar/soroban-cli" +homepage = "https://github.com/stellar/stellar-cli" +repository = "https://github.com/stellar/stellar-cli" authors = ["Stellar Development Foundation "] license = "Apache-2.0" readme = "README.md" diff --git a/cmd/soroban-cli/src/commands/mod.rs b/cmd/soroban-cli/src/commands/mod.rs index 4b56f76df..4552f93b3 100644 --- a/cmd/soroban-cli/src/commands/mod.rs +++ b/cmd/soroban-cli/src/commands/mod.rs @@ -20,7 +20,7 @@ pub const HEADING_RPC: &str = "Options (RPC)"; const ABOUT: &str = "Build, deploy, & interact with contracts; set identities to sign with; configure networks; generate keys; and more. Stellar Docs: https://developers.stellar.org -CLI Full Hep Docs: https://github.com/stellar/soroban-cli/tree/main/FULL_HELP_DOCS.md"; +CLI Full Hep Docs: https://github.com/stellar/stellar-cli/tree/main/FULL_HELP_DOCS.md"; // long_about is shown when someone uses `--help`; short help when using `-h` const LONG_ABOUT: &str = " diff --git a/cmd/stellar-cli/Cargo.toml b/cmd/stellar-cli/Cargo.toml index 59684bd62..6c0610b6f 100644 --- a/cmd/stellar-cli/Cargo.toml +++ b/cmd/stellar-cli/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "stellar-cli" description = "Stellar CLI" -homepage = "https://github.com/stellar/soroban-cli" -repository = "https://github.com/stellar/soroban-cli" +homepage = "https://github.com/stellar/stellar-cli" +repository = "https://github.com/stellar/stellar-cli" authors = ["Stellar Development Foundation "] license = "Apache-2.0" readme = "README.md" From 2994d95fe937f4c52e2cb8bf431fdbc266a7d154 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 30 May 2024 21:11:28 -0700 Subject: [PATCH 2/3] Install stellar and soroban CLIs when installing either (#1350) --- Makefile | 5 ++--- cmd/soroban-cli/Cargo.toml | 4 ++++ cmd/stellar-cli/Cargo.toml | 4 ++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7c2f8a78c..7e307b16c 100644 --- a/Makefile +++ b/Makefile @@ -27,9 +27,8 @@ endif install_rust: install install: - cargo install --locked --path ./cmd/soroban-cli --debug - cargo install --locked --path ./cmd/stellar-cli --debug - cargo install --locked --path ./cmd/crates/soroban-test/tests/fixtures/hello --root ./target --debug --quiet + cargo install --force --locked --path ./cmd/stellar-cli --debug + cargo install --force --locked --path ./cmd/crates/soroban-test/tests/fixtures/hello --root ./target --debug --quiet # regenerate the example lib in `cmd/crates/soroban-spec-typsecript/fixtures/ts` build-snapshot: typescript-bindings-fixtures diff --git a/cmd/soroban-cli/Cargo.toml b/cmd/soroban-cli/Cargo.toml index c0142e1e6..0950aa94d 100644 --- a/cmd/soroban-cli/Cargo.toml +++ b/cmd/soroban-cli/Cargo.toml @@ -12,6 +12,10 @@ rust-version.workspace = true autobins = false default-run = "soroban" +[[bin]] +name = "stellar" +path = "src/bin/main.rs" + [[bin]] name = "soroban" path = "src/bin/main.rs" diff --git a/cmd/stellar-cli/Cargo.toml b/cmd/stellar-cli/Cargo.toml index 6c0610b6f..23e4c741e 100644 --- a/cmd/stellar-cli/Cargo.toml +++ b/cmd/stellar-cli/Cargo.toml @@ -16,6 +16,10 @@ default-run = "stellar" name = "stellar" path = "src/bin/main.rs" +[[bin]] +name = "soroban" +path = "src/bin/main.rs" + [package.metadata.binstall] pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ version }-{ target }{ archive-suffix }" bin-dir = "{ bin }{ binary-ext }" From 67840a34c736e137a23fbd99ede03b6125740438 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 30 May 2024 22:46:19 -0700 Subject: [PATCH 3/3] Build artifacts for both stellar-cli and soroban-cli (#1351) --- .github/workflows/binaries.yml | 37 +++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/.github/workflows/binaries.yml b/.github/workflows/binaries.yml index 89ad70901..97304b7bd 100644 --- a/.github/workflows/binaries.yml +++ b/.github/workflows/binaries.yml @@ -15,53 +15,58 @@ jobs: strategy: fail-fast: false matrix: - include: + crate: + - name: stellar-cli + binary: stellar + - name: soroban-cli + binary: soroban + sys: - os: ubuntu-20.04 # Use 20.04 to get an older version of glibc for increased compat target: x86_64-unknown-linux-gnu - os: ubuntu-20.04 # Use 20.04 to get an older version of glibc for increased compat target: aarch64-unknown-linux-gnu - - os: macos-latest + - os: macos-14 target: x86_64-apple-darwin - - os: macos-latest + - os: macos-12 target: aarch64-apple-darwin - os: windows-latest target: x86_64-pc-windows-msvc ext: .exe - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.sys.os }} steps: - uses: actions/checkout@v3 - run: rustup update - - run: rustup target add ${{ matrix.target }} - - if: matrix.target == 'aarch64-unknown-linux-gnu' + - run: rustup target add ${{ matrix.sys.target }} + - if: matrix.sys.target == 'aarch64-unknown-linux-gnu' run: sudo apt-get update && sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - name: Setup vars run: | - version="$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[] | select(.name == "soroban-cli") | .version')" + version="$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[] | select(.name == "stellar-cli") | .version')" echo "VERSION=${version}" >> $GITHUB_ENV - echo "NAME=soroban-cli-${version}-${{ matrix.target }}" >> $GITHUB_ENV + echo "NAME=${{ matrix.crate.name }}-${version}-${{ matrix.sys.target }}" >> $GITHUB_ENV - name: Package (release only) if: github.event_name == 'release' - run: cargo package --no-verify + run: cargo package --no-verify --package ${{ matrix.crate.name }} - name: Package Extract (release only) if: github.event_name == 'release' run: | cd target/package - tar xvfz soroban-cli-$VERSION.crate - echo "BUILD_WORKING_DIR=target/package/soroban-cli-$VERSION" >> $GITHUB_ENV + tar xvfz ${{ matrix.crate.name }}-$VERSION.crate + echo "BUILD_WORKING_DIR=target/package/${{ matrix.crate.name }}-$VERSION" >> $GITHUB_ENV - name: Build env: CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc working-directory: ${{ env.BUILD_WORKING_DIR }} - run: cargo build --target-dir="$GITHUB_WORKSPACE/target" --features opt --release --target ${{ matrix.target }} + run: cargo build --target-dir="$GITHUB_WORKSPACE/target" --package ${{ matrix.crate.name }} --features opt --release --target ${{ matrix.sys.target }} - name: Compress run: | - cd target/${{ matrix.target }}/release - tar czvf $NAME.tar.gz soroban${{ matrix.ext }} + cd target/${{ matrix.sys.target }}/release + tar czvf $NAME.tar.gz ${{ matrix.crate.binary }}${{ matrix.sys.ext }} - name: Upload to Artifacts uses: actions/upload-artifact@v3 with: name: ${{ env.NAME }} - path: 'target/${{ matrix.target }}/release/${{ env.NAME }}.tar.gz' + path: 'target/${{ matrix.sys.target }}/release/${{ env.NAME }}.tar.gz' - name: Upload to Release (release only) if: github.event_name == 'release' uses: actions/github-script@v6 @@ -73,5 +78,5 @@ jobs: repo: context.repo.repo, release_id: ${{ github.event.release.id }}, name: '${{ env.NAME }}.tar.gz', - data: fs.readFileSync('target/${{ matrix.target }}/release/${{ env.NAME }}.tar.gz'), + data: fs.readFileSync('target/${{ matrix.sys.target }}/release/${{ env.NAME }}.tar.gz'), });