Skip to content

Commit

Permalink
feat: enable nano s app again + change default flags (#113)
Browse files Browse the repository at this point in the history
* nanoS light version

* bump version

* Remove nanoXL from CI

* fix: reorganize ci

* fix: set production_build flag to 1 by default

---------

Co-authored-by: emmanuelm41 <[email protected]>
  • Loading branch information
0xPxt and emmanuelm41 authored Oct 29, 2024
1 parent 87a5f0f commit febc986
Show file tree
Hide file tree
Showing 16 changed files with 1,478 additions and 1,535 deletions.
180 changes: 109 additions & 71 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,32 +58,6 @@ jobs:
cd ./app/rust
cargo test
build_ledger:
needs: configure
runs-on: ubuntu-latest
container:
image: zondax/ledger-app-builder:latest
options: --user ${{ needs.configure.outputs.uid_gid }}
env:
BOLOS_SDK: /opt/nanos-secure-sdk
outputs:
size: ${{steps.build.outputs.size}}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Build Standard app
id: build
shell: bash -l {0}
run: |
SUBSTRATE_PARSER_FULL=1 make
echo "size=$(python3 deps/ledger-zxlib/scripts/getSize.py s)" >> $GITHUB_OUTPUT
- name: Build SR25519 app
shell: bash -l {0}
run: |
SUBSTRATE_PARSER_FULL=1 SUPPORT_SR25519=1 make
test_zemu:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -116,57 +90,121 @@ jobs:
name: snapshots-tmp
path: tests_zemu/snapshots-tmp/

# Comment out nanoS build, the device is not supported anymore.
build_ledger_light:
needs: configure
runs-on: ubuntu-latest
container:
image: zondax/ledger-app-builder:latest
options: --user ${{ needs.configure.outputs.uid_gid }}
env:
BOLOS_SDK: /opt/nanos-secure-sdk
outputs:
size: ${{steps.build.outputs.size}}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Build Light app
id: build
shell: bash -l {0}
run: |
SUBSTRATE_PARSER_FULL=0 make
echo "size=$(python3 deps/ledger-zxlib/scripts/getSize.py s)" >> $GITHUB_OUTPUT
- name: Build SR25519 app
shell: bash -l {0}
run: |
SUBSTRATE_PARSER_FULL=0 SUPPORT_SR25519=1 make
size_nano_s:
needs: build_ledger_light
runs-on: ubuntu-latest
env:
NANOS_LIMIT_SIZE: 136
steps:
- run: |
echo "LNS app size: ${{needs.build_ledger_light.outputs.size}} KiB"
[ ${{needs.build_ledger_light.outputs.size}} -le $NANOS_LIMIT_SIZE ]
build_package_nanos:
needs: [configure, build, build_ledger_light, 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/nanos-secure-sdk
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Install deps
run: pip install ledgerblue

- name: Build NanoS
shell: bash -l {0}
run: |
make SUBSTRATE_PARSER_FULL=0 PRODUCTION_BUILD=0
mv ./app/pkg/installer_s.sh ./app/pkg/installer_nanos.sh
- name: Set tag
id: nanos_light
run: echo "tag_name=$(./app/pkg/installer_nanos.sh version)" >> $GITHUB_OUTPUT
- name: Create or Update Release (1)
id: create_release_0
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_nanos.sh
tag_name: ${{ steps.nanos_light.outputs.tag_name }}
draft: false
prerelease: false


# Comment out nanoS XL build, the device is not supported anymore due to the size limit.
# The github workflow for the latest supported version is running in nanos.yml

# size_nano_s:
# needs: build_ledger
# build_ledger_xl:
# needs: configure
# runs-on: ubuntu-latest
# container:
# image: zondax/ledger-app-builder:latest
# options: --user ${{ needs.configure.outputs.uid_gid }}
# env:
# BOLOS_SDK: /opt/nanos-secure-sdk
# outputs:
# size: ${{steps.build.outputs.size}}
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# submodules: true
# - name: Build XL app
# id: build
# shell: bash -l {0}
# run: |
# SUBSTRATE_PARSER_FULL=1 make
# echo "size=$(python3 deps/ledger-zxlib/scripts/getSize.py s)" >> $GITHUB_OUTPUT
# - name: Build SR25519 app
# shell: bash -l {0}
# run: |
# SUBSTRATE_PARSER_FULL=1 SUPPORT_SR25519=1 make
#
#
# size_nano_s_xl:
# needs: build_ledger_xl
# runs-on: ubuntu-latest
# env:
# NANOS_LIMIT_SIZE: 136
# steps:
# - run: |
# echo "LNS app size: ${{needs.build_ledger.outputs.size}} KiB"
# [ ${{needs.build_ledger.outputs.size}} -le $NANOS_LIMIT_SIZE ]

# build_package_nanos:
# 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/nanos-secure-sdk
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# submodules: true
# - name: Install deps
# run: pip install ledgerblue
#
# - name: Build NanoS
# shell: bash -l {0}
# run: |
# make SUBSTRATE_PARSER_FULL=0 PRODUCTION_BUILD=0
# mv ./app/pkg/installer_s.sh ./app/pkg/installer_nanos.sh
# - name: Set tag
# id: nanos_light
# run: echo "tag_name=$(./app/pkg/installer_nanos.sh version)" >> $GITHUB_OUTPUT
# - name: Create or Update Release (1)
# id: create_release_0
# 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_nanos.sh
# tag_name: ${{ steps.nanos_light.outputs.tag_name }}
# draft: false
# prerelease: false
# echo "LNS app size: ${{needs.build_ledger_xl.outputs.size}} KiB"
# [ ${{needs.build_ledger_xl.outputs.size}} -le $NANOS_LIMIT_SIZE ]

# build_package_nanos_xl:
# needs: [configure, build, build_ledger, test_zemu]
# needs: [configure, build, build_ledger_xl, test_zemu, size_nano_s_xl]
# if: ${{ github.ref == 'refs/heads/main' }}
# runs-on: ubuntu-latest
# container:
Expand Down Expand Up @@ -202,7 +240,7 @@ jobs:
# prerelease: false

build_package_nanosp:
needs: [configure, build, build_ledger, test_zemu]
needs: [configure, build, build_ledger_light, test_zemu]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
container:
Expand Down Expand Up @@ -238,7 +276,7 @@ jobs:
prerelease: false

build_package_stax:
needs: [configure, build, build_ledger, test_zemu]
needs: [configure, build, build_ledger_light, test_zemu]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
container:
Expand Down Expand Up @@ -272,7 +310,7 @@ jobs:
prerelease: false

build_package_flex:
needs: [configure, build, build_ledger, test_zemu]
needs: [configure, build, build_ledger_light, test_zemu]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
container:
Expand Down
140 changes: 0 additions & 140 deletions .github/workflows/nanos.yml

This file was deleted.

1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ ifeq ($(BOLOS_SDK),)
# In this case, there is not predefined SDK and we run dockerized
# When not using the SDK, we override and build the XL complete app

ZXLIB_COMPILE_STAX ?= 1
SUBSTRATE_PARSER_FULL ?= 1
PRODUCTION_BUILD ?= 1
include $(CURDIR)/deps/ledger-zxlib/dockerized_build.mk
Expand Down
4 changes: 2 additions & 2 deletions app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.installer_script

include $(BOLOS_SDK)/Makefile.defines

# Set the default value for PRODUCTION_BUILD to 0 if not already defined
PRODUCTION_BUILD ?= 0
# Set the default value for PRODUCTION_BUILD to 1 if not already defined
PRODUCTION_BUILD ?= 1

$(info ************ TARGET_NAME = [$(TARGET_NAME)])

Expand Down
2 changes: 1 addition & 1 deletion app/Makefile.version
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ APPVERSION_M=107
# This is the `spec_version` field of `Runtime`
APPVERSION_N=7000
# This is the patch version of this release
APPVERSION_P=1
APPVERSION_P=2
Loading

0 comments on commit febc986

Please sign in to comment.