diff --git a/.github/workflows/python-client.yml b/.github/workflows/python-client.yml index ca8f164..8a063a4 100644 --- a/.github/workflows/python-client.yml +++ b/.github/workflows/python-client.yml @@ -6,7 +6,13 @@ on: branches: - develop - master + paths: + - ./client/ + - .github/workflows/python-client.yml pull_request: + paths: + - ./client/ + - .github/workflows/python-client.yml jobs: lint: @@ -29,15 +35,15 @@ jobs: - name: Mypy type checking run: (cd client && mypy src/) - build: - name: Building the package - runs-on: ubuntu-latest - steps: - - name: Clone - uses: actions/checkout@v3 - - run: pip install --upgrade pip build twine - - name: Build and test the package - run: | - cd client/ - python -m build . - python -m twine check dist/* + packaging: + needs: [lint, mypy] + if: github.event_name == 'push' + name: Build, test and deploy the Python package + uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_pypi_deployment.yml@v1 + with: + package_directory: "client/" + stable_deployment: ${{ github.ref == 'refs/heads/master' }} + check_changelog_version: true + publish: ${{ github.event_name == 'push' }} + secrets: + pypi_token: ${{ github.ref == 'refs/heads/master' && secrets.PYPI_PUBLIC_API_TOKEN || secrets.TEST_PYPI_PUBLIC_API_TOKEN }}