Skip to content

Commit

Permalink
[Rust] Use cargo metadata and jq to get binary name when compiling Ru…
Browse files Browse the repository at this point in the history
…st application
  • Loading branch information
yogh333 committed Feb 13, 2024
1 parent da14009 commit a7365eb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/reusable_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,11 @@ jobs:
BIN_DIR_NAME="$(echo ${{ matrix.device }} | sed 's/nanosp/nanos2/')" && \
cd ${{ needs.call_get_app_metadata.outputs.build_directory }} && \
cargo ledger build ${BUILD_DEVICE_NAME} -- -Zunstable-options --out-dir=./build/${BIN_DIR_NAME}/bin/ && \
APP_NAME=$(grep -E '^\s*name\s*=\s*' Cargo.toml | head -n 1 | awk -F'["]' '{print $2}') && \
mv ./build/${BIN_DIR_NAME}/bin/${APP_NAME} ./build/${BIN_DIR_NAME}/bin/app.elf
echo "Build complete" && \
APP_NAME=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[].name') && \
echo "APP_NAME=${APP_NAME}" && \
mv ./build/${BIN_DIR_NAME}/bin/${APP_NAME} ./build/${BIN_DIR_NAME}/bin/app.elf && \
echo "Binary ./build/${BIN_DIR_NAME}/bin/${APP_NAME} copied as ./build/${BIN_DIR_NAME}/bin/app.elf"
else
eval "BOLOS_SDK=\$$(echo ${{ matrix.device }} | tr [:lower:] [:upper:])_SDK" && \
echo "BOLOS_SDK value will be: ${BOLOS_SDK}" && \
Expand Down

0 comments on commit a7365eb

Please sign in to comment.