Skip to content

Commit

Permalink
[add] An input can allow the reusable build to checkout the SDK befor…
Browse files Browse the repository at this point in the history
…e building
  • Loading branch information
lpascal-ledger committed Jan 22, 2025
1 parent bdcddcd commit 4cdff16
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/reusable_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ on:
required: false
default: 'ledger-app-builder-lite'
type: string
sdk_ref:
description: |
A SDK reference to checkout before building the app. Does not apply on Rust application
Default behavior is to build on the current version of the app-builder Docker image.
As the branch `master` exists locally, `origin/master` should be used to checkout the
actual, current SDK master branch.
required: false
default: ""
type: string

jobs:
call_get_app_metadata:
Expand Down Expand Up @@ -115,9 +125,13 @@ jobs:
echo "binary_path=$binary_path" && \
echo "Build complete"
else
eval "BOLOS_SDK=\$$(echo ${{ matrix.device }} | tr [:lower:] [:upper:])_SDK" && \
echo "BOLOS_SDK value will be: ${BOLOS_SDK}" && \
make -C ${{ needs.call_get_app_metadata.outputs.build_directory }} -j ${{ inputs.flags }} BOLOS_SDK=${BOLOS_SDK} && \
eval "BOLOS_SDK=\$$(echo ${{ matrix.device }} | tr [:lower:] [:upper:])_SDK"
echo "BOLOS_SDK value will be: ${BOLOS_SDK}"
if [ -n "${{ inputs.sdk_ref }}" ];
then
(cd $BOLOS_SDK && git fetch -apt && git checkout ${{ inputs.sdk_ref }})
fi
make -C ${{ needs.call_get_app_metadata.outputs.build_directory }} -j ${{ inputs.flags }} BOLOS_SDK=${BOLOS_SDK}
echo "binary_path=${{ needs.call_get_app_metadata.outputs.build_directory }}/build/*" >> $GITHUB_OUTPUT
echo "Build complete"
fi
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/reusable_build_several.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ on:
required: false
default: 'all'
type: string
sdk_ref:
description: |
A SDK reference to checkout before building the app. Does not apply on Rust application
Default behavior is to build on the current version of the app-builder Docker image.
As the branch `master` exists locally, `origin/master` should be used to checkout the
actual, current SDK master branch.
required: false
default: ""
type: string

jobs:

Expand All @@ -47,3 +57,4 @@ jobs:
upload_app_binaries_artifact: ${{ matrix.app.name }} # else will colide with other matrix' jobs
app_branch_name: ${{ matrix.app.default_branch }} # else takes the current repo default branch
builder: ledger-app-builder # needed for Rust applications
sdk_ref: ${{ inputs.sdk_ref }}

0 comments on commit 4cdff16

Please sign in to comment.