From 02862f1f57de202c69410ac1bf5cca9f419a6120 Mon Sep 17 00:00:00 2001 From: Carlos Medeiros Date: Mon, 30 Sep 2024 11:43:16 +0100 Subject: [PATCH] add flex support --- .github/workflows/codeql.yml | 5 +++-- .github/workflows/main.yml | 37 ++++++++++++++++++++++++++++++++++- app/flex_icon.gif | Bin 0 -> 144 bytes app/src/common/tx.c | 4 ++-- flex_icon.gif | Bin 0 -> 144 bytes ledger_app.toml | 2 +- 6 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 app/flex_icon.gif create mode 100644 flex_icon.gif diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 70ebd77..d35e417 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -8,7 +8,7 @@ on: - main - develop - master # for safety reasons - - dev # for safety reasons + - dev # for safety reasons jobs: analyse: @@ -16,7 +16,8 @@ jobs: if: github.event.repository.private == false strategy: matrix: - sdk: ["$NANOS_SDK", "$NANOX_SDK", "$NANOSP_SDK", "$STAX_SDK"] + sdk: + ["$NANOS_SDK", "$NANOX_SDK", "$NANOSP_SDK", "$STAX_SDK", "$FLEX_SDK"] runs-on: ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }} container: image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-legacy:latest diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3f506cd..c496598 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ on: - main - develop - master # for safety reasons - - dev # for safety reasons + - dev # for safety reasons jobs: configure: @@ -231,3 +231,38 @@ jobs: tag_name: ${{ steps.stax.outputs.tag_name }} draft: false prerelease: false + + build_package_flex: + needs: [configure, build, build_ledger, test_zemu] + if: ${{ github.ref == 'refs/heads/main' }} + runs-on: ubuntu-latest + container: + image: zondax/ledger-app-builder:latest + options: --user ${{ needs.configure.outputs.uid_gid }} + env: + BOLOS_SDK: /opt/flex-secure-sdk + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + - name: Install deps + run: pip install ledgerblue + + - name: Build Flex + shell: bash -l {0} + run: | + PRODUCTION_BUILD=0 make + - name: Set tag + id: flex + run: echo "tag_name=$(./app/pkg/installer_flex.sh version)" >> $GITHUB_OUTPUT + - name: Update Release + id: update_release_2 + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + files: ./app/pkg/installer_flex.sh + tag_name: ${{ steps.flex.outputs.tag_name }} + draft: false + prerelease: false diff --git a/app/flex_icon.gif b/app/flex_icon.gif new file mode 100644 index 0000000000000000000000000000000000000000..8e5ce8353dea05c87db91e5b379f3efcad752326 GIT binary patch literal 144 zcmZ?wbhEHb)L_tH_`t{j1poj4SNzEWVln7|2#^c|Q+iMT%F}Q87th&pt9$dkJ-_+e z_#CDkNLuz}$vThOn?7*Q4ywJ9)goQR^YU!k!LS1!n?>u_9m)IY%qV{*Z4*nc)qGwV tBlEXH?eQPCXPFjXT)yVg@jX-f3+29BiNE~*XWxH*2@MO6ia-ViYXGeRJq7>( literal 0 HcmV?d00001 diff --git a/app/src/common/tx.c b/app/src/common/tx.c index 20aed95..632a418 100644 --- a/app/src/common/tx.c +++ b/app/src/common/tx.c @@ -23,7 +23,7 @@ #include "parser.h" #include "zxmacros.h" -#if defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) +#if defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) || defined(TARGET_FLEX) #define RAM_BUFFER_SIZE 8192 #define FLASH_BUFFER_SIZE 16384 #elif defined(TARGET_NANOS) @@ -39,7 +39,7 @@ typedef struct { uint8_t buffer[FLASH_BUFFER_SIZE]; } storage_t; -#if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) +#if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) || defined(TARGET_FLEX) storage_t NV_CONST N_appdata_impl __attribute__((aligned(64))); #define N_appdata (*(NV_VOLATILE storage_t *)PIC(&N_appdata_impl)) #endif diff --git a/flex_icon.gif b/flex_icon.gif new file mode 100644 index 0000000000000000000000000000000000000000..8e5ce8353dea05c87db91e5b379f3efcad752326 GIT binary patch literal 144 zcmZ?wbhEHb)L_tH_`t{j1poj4SNzEWVln7|2#^c|Q+iMT%F}Q87th&pt9$dkJ-_+e z_#CDkNLuz}$vThOn?7*Q4ywJ9)goQR^YU!k!LS1!n?>u_9m)IY%qV{*Z4*nc)qGwV tBlEXH?eQPCXPFjXT)yVg@jX-f3+29BiNE~*XWxH*2@MO6ia-ViYXGeRJq7>( literal 0 HcmV?d00001 diff --git a/ledger_app.toml b/ledger_app.toml index 3e4cbb1..d8530d3 100644 --- a/ledger_app.toml +++ b/ledger_app.toml @@ -1,7 +1,7 @@ [app] build_directory = "./app/" sdk = "C" -devices = ["nanos", "nanox", "nanos+", "stax"] +devices = ["nanos", "nanox", "nanos+", "stax", #flex"] [tests] unit_directory = "./tests/"