Skip to content

Commit

Permalink
Merge branch 'main' into alias
Browse files Browse the repository at this point in the history
  • Loading branch information
fnando authored Jun 4, 2024
2 parents 0ae1aeb + 67840a3 commit 58a35e4
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 25 deletions.
37 changes: 21 additions & 16 deletions .github/workflows/binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'),
});
2 changes: 1 addition & 1 deletion FULL_HELP_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions cmd/soroban-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
license = "Apache-2.0"
readme = "README.md"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "
Expand Down
8 changes: 6 additions & 2 deletions cmd/stellar-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
license = "Apache-2.0"
readme = "README.md"
Expand All @@ -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 }"
Expand Down

0 comments on commit 58a35e4

Please sign in to comment.