diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab6feda..1d23f36 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,104 +40,14 @@ jobs: name: codecov-ledgerwallet deploy: - name: Build the Python package and deploy if needed - runs-on: public-ledgerhq-shared-small + name: Build and deploy ledgerwallet package needs: [build_install_test] - permissions: - id-token: write - attestations: write - contents: write - steps: - - name: Clone - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Install dependencies - run: | - # Needed to workaround this bug https://github.com/pypa/setuptools/issues/4759 - # To be removed when it's fixed - pip install -U packaging - - python -m pip install pip --upgrade - pip install build twine - - - name: Build the Python package - run: | - python -m build - twine check dist/* - echo "TAG_VERSION=$(python -c 'from ledgerwallet import __version__; print(__version__)')" >> "$GITHUB_ENV" - - - name: Display current status - run: | - echo "Current status is:" - if [[ ${{ github.ref }} == "refs/tags/"* ]]; \ - then \ - echo "- Triggered from tag, will be deployed on pypi.org"; \ - else \ - echo "- Not triggered from tag, will be deployed on test.pypi.org"; \ - fi - echo "- Tag version: ${{ env.TAG_VERSION }}" - - - name: Check version against CHANGELOG - if: startsWith(github.ref, 'refs/tags/') - run: | - CHANGELOG_VERSION=$(grep -Po '(?<=## \[)(\d+\.)+[^\]]' CHANGELOG.md | head -n 1) - if [ "${{ env.TAG_VERSION }}" == "${CHANGELOG_VERSION}" ]; \ - then \ - exit 0; \ - else \ - echo "Tag '${{ env.TAG_VERSION }}' and CHANGELOG '${CHANGELOG_VERSION}' versions mismatch!"; \ - exit 1; \ - fi - - - name: Publish Python package on pypi.org - if: success() && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - run: python -m twine upload dist/* --verbose - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_PUBLIC_API_TOKEN }} - TWINE_NON_INTERACTIVE: 1 - - - name: Login to Ledger Artifactory - if: success() && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - timeout-minutes: 10 - id: jfrog-login - uses: LedgerHQ/actions-security/actions/jfrog-login@actions/jfrog-login-1 - - - name: Publish Python package on Ledger Artifactory - if: success() && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - run: python -m twine upload dist/* - env: - TWINE_REPOSITORY_URL: https://jfrog.ledgerlabs.net/artifactory/api/pypi/embedded-apps-pypi-prod-green - TWINE_USERNAME: ${{ steps.jfrog-login.outputs.oidc-user }} - TWINE_PASSWORD: ${{ steps.jfrog-login.outputs.oidc-token }} - TWINE_NON_INTERACTIVE: 1 - - - name: Generate library build attestations - if: success() && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - timeout-minutes: 10 - uses: LedgerHQ/actions-security/actions/attest@actions/attest-1 - with: - subject-path: dist/* - - - name: Sign library artifacts - if: success() && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - timeout-minutes: 10 - uses: LedgerHQ/actions-security/actions/sign-blob@actions/sign-blob-1 - with: - path: dist - - - name: Publish a release on the repo - if: | - success() && - github.event_name == 'push' && - startsWith(github.ref, 'refs/tags/') - uses: "marvinpinto/action-automatic-releases@latest" - with: - automatic_release_tag: "v${{ env.TAG_VERSION }}" - repo_token: "${{ secrets.GITHUB_TOKEN }}" - prerelease: true - files: | - LICENSE - dist/ + uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_pypi_deployment.yml@v1 + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + with: + package_name: ledgerwallet + jfrog_deployment: true + release: true + publish: true + secrets: + pypi_token: ${{ secrets.PYPI_PUBLIC_API_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8b90e0c..0cdcdd7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -46,3 +46,9 @@ repos: rev: 5.12.0 hooks: - id: isort + + - repo: https://github.com/rhysd/actionlint + rev: v1.6.27 + hooks: + - id: actionlint + files: ^\.github/workflows/.*\.ya?ml$ diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c1c8ba..b947a03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.5.6] - 2026-02-24 + +### Fixed + +- Fix api-level 0 handling +- Update deployment workflows + ## [0.5.5] - 2025-11-26 ### Fixed diff --git a/ledgerwallet/client.py b/ledgerwallet/client.py index 5c2b0f3..5cc5a63 100644 --- a/ledgerwallet/client.py +++ b/ledgerwallet/client.py @@ -266,7 +266,7 @@ def install_app(self, app_manifest: AppManifest): main_address = hex_file.start_addr["EIP"] - hex_file.minaddr() level = app_manifest.get_api_level(device) - if level: + if level is not None: data = struct.pack( ">BIIIII", level,