[ci][add] Using the 'reusable_pypi_deployment' workflow for Pytho package deployment

This commit is contained in:
Lucas PASCAL
2023-07-28 19:07:55 +02:00
parent 54b979186d
commit 72586268fa

View File

@@ -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 }}