From 3224ad185f2871f80f3a682b0411fb730750e540 Mon Sep 17 00:00:00 2001 From: GroM Date: Tue, 6 Feb 2024 10:18:29 +0100 Subject: [PATCH] Get build_directory and devices from Ledger manifest --- .github/workflows/build_all_apps.yml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build_all_apps.yml b/.github/workflows/build_all_apps.yml index f4e942ba..d00e6b83 100644 --- a/.github/workflows/build_all_apps.yml +++ b/.github/workflows/build_all_apps.yml @@ -17,23 +17,20 @@ jobs: fail-fast: false matrix: include: - - repo: 'app-mobilecoin' - branch: 'develop' - build_path: './fw' - device: nanosplus + #- repo: 'app-mobilecoin' + # branch: 'develop' - repo: 'app-radix-babylon' branch: 'develop' - build_path: './' - device: nanos nanox nanosplus - repo: 'app-boilerplate-rust' branch: 'main' - build_path: './' - device: nanos nanox nanosplus runs-on: ubuntu-latest container: image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest steps: + - name: Install dependencies + run: pip install ledgered + - name: Clone SDK uses: actions/checkout@v4 with: @@ -50,7 +47,9 @@ jobs: - name: Patch Cargo.toml continue-on-error: false run: | - cd ${{ matrix.repo }}-${{ matrix.branch }}/${{ matrix.build_path }} + cd ${{ matrix.repo }}-${{ matrix.branch }} + build_directory=$(ledger-manifest --output-build-directory ledger_app.toml) + cd $build_directory # Patch ledger_device_sdk if grep -Fxq "[patch.crates-io.ledger_device_sdk]" Cargo.toml; then echo "The patch already exists in the file." @@ -76,8 +75,12 @@ jobs: - name: Build run: | - cd ${{ matrix.repo }}-${{ matrix.branch }}/${{ matrix.build_path }} - for device in ${{ matrix.device }}; do + cd ${{ matrix.repo }}-${{ matrix.branch }} + build_directory=$(ledger-manifest --output-build-directory ledger_app.toml) + devices="$(ledger-manifest --output-devices ledger_app.toml | sed 's/+/plus/')" + formatted_devices=$(echo $devices | sed "s/\['//;s/'\]//;s/', '/ /g") + cd $build_directory + for device in $formatted_devices; do # Required as patch has a different version from what is locked in Cargo.lock cargo +$RUST_NIGHTLY update ledger_device_sdk cargo +$RUST_NIGHTLY update ledger_secure_sdk_sys