Skip to content

Commit 81fa0db

Browse files
committed
[ci][clean] Using reusable workflow to build & publish the Ethereum client Python package
1 parent be53fee commit 81fa0db

2 files changed

Lines changed: 10 additions & 38 deletions

File tree

.github/workflows/python-client.yml

Lines changed: 9 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -39,42 +39,13 @@ jobs:
3939
run: (cd client && mypy src/)
4040

4141
package_and_deploy:
42-
name: Build and deploy Ethereum Client Python package
43-
runs-on: ubuntu-latest
42+
name: Build and deploy the Ethereum client Python package
4443
needs: [lint, mypy]
45-
steps:
46-
47-
- name: Clone
48-
uses: actions/checkout@v4
49-
with:
50-
fetch-depth: 0
51-
52-
- name: Build Python package
53-
run: |
54-
pip install --upgrade pip build twine
55-
cd client/
56-
python -m build;
57-
python -m twine check dist/*
58-
pip install .;
59-
echo "TAG_VERSION=$(python -c 'from ledger_app_clients.ethereum import __version__; print(__version__)')" >> "$GITHUB_ENV"
60-
61-
- name: Check version against CHANGELOG
62-
if: startsWith(github.ref, 'refs/tags/')
63-
run: |
64-
CHANGELOG_VERSION=$(grep -Po '(?<=## \[)(\d+\.)+[^\]]' client/CHANGELOG.md | head -n 1)
65-
if [ "${{ env.TAG_VERSION }}" == "${CHANGELOG_VERSION}" ];
66-
then
67-
echo 'Package and CHANGELOG versions match!';
68-
exit 0;
69-
else
70-
echo "Tag '${{ env.TAG_VERSION }}' and CHANGELOG '${CHANGELOG_VERSION}' versions mismatch!";
71-
exit 1;
72-
fi
73-
74-
- name: Publish Python package on pypi.org
75-
if: success() && github.event_name == 'push'
76-
run: (cd client && python -m twine upload --verbose dist/*)
77-
env:
78-
TWINE_USERNAME: __token__
79-
TWINE_PASSWORD: ${{ secrets.PYPI_PUBLIC_API_TOKEN }}
80-
TWINE_NON_INTERACTIVE: 1
44+
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_pypi_deployment.yml@lpa/reusable_pypi
45+
with:
46+
package_name: ledger_app_clients.ethereum
47+
publish: ${{ startsWith(github.ref, 'refs/tags/') }}
48+
package_directory: ./client/
49+
jfrog_deployment: false
50+
secrets:
51+
pypi_token: ${{ secrets.PYPI_PUBLIC_API_TOKEN }}

client/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../LICENSE

0 commit comments

Comments
 (0)