[ci][fix] Falling back to explicit package build, test & publish rather than using the reusable workflow
This commit is contained in:
53
.github/workflows/python-client.yml
vendored
53
.github/workflows/python-client.yml
vendored
@@ -24,9 +24,9 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- run: pip install flake8
|
- run: pip install flake8 flake8-pyproject
|
||||||
- name: Flake8 lint Python code
|
- name: Flake8 lint Python code
|
||||||
run: (cd client && find src/ -type f -name '*.py' -exec flake8 --max-line-length=120 '{}' '+')
|
run: (cd client && flake8 src/)
|
||||||
|
|
||||||
mypy:
|
mypy:
|
||||||
name: Type checking
|
name: Type checking
|
||||||
@@ -38,14 +38,43 @@ jobs:
|
|||||||
- name: Mypy type checking
|
- name: Mypy type checking
|
||||||
run: (cd client && mypy src/)
|
run: (cd client && mypy src/)
|
||||||
|
|
||||||
packaging:
|
package_and_deploy:
|
||||||
|
name: Build and deploy Ethereum Client Python package
|
||||||
|
runs-on: ubuntu-latest
|
||||||
needs: [lint, mypy]
|
needs: [lint, mypy]
|
||||||
name: Build, test and deploy the Python package
|
steps:
|
||||||
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_pypi_deployment.yml@v1
|
|
||||||
with:
|
- name: Clone
|
||||||
package_directory: "client/"
|
uses: actions/checkout@v3
|
||||||
stable_deployment: true
|
with:
|
||||||
check_changelog_version: ${{ startsWith(github.ref,'refs/tags/') }}
|
fetch-depth: 0
|
||||||
publish: ${{ github.event_name == 'push' }}
|
|
||||||
secrets:
|
- name: Build Python package
|
||||||
pypi_token: secrets.PYPI_PUBLIC_API_TOKEN
|
run: |
|
||||||
|
pip install --upgrade pip build twine
|
||||||
|
cd client/
|
||||||
|
python -m build;
|
||||||
|
python -m twine check dist/*
|
||||||
|
pip install .;
|
||||||
|
echo "TAG_VERSION=$(python -c 'from ledger_app_clients.ethereum import __version__; print(__version__)')" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
- name: Check version against CHANGELOG
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
run: |
|
||||||
|
CHANGELOG_VERSION=$(grep -Po '(?<=## \[)(\d+\.)+[^\]]' client/CHANGELOG.md | head -n 1)
|
||||||
|
if [ "${{ env.TAG_VERSION }}" == "${CHANGELOG_VERSION}" ];
|
||||||
|
then
|
||||||
|
echo 'Package and CHANGELOG versions match!';
|
||||||
|
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'
|
||||||
|
run: (cd client && python -m twine upload --verbose dist/*)
|
||||||
|
env:
|
||||||
|
TWINE_USERNAME: __token__
|
||||||
|
TWINE_PASSWORD: ${{ secrets.PYPI_PUBLIC_API_TOKEN }}
|
||||||
|
TWINE_NON_INTERACTIVE: 1
|
||||||
|
|||||||
@@ -46,3 +46,6 @@ Home = "https://github.com/LedgerHQ/app-ethereum"
|
|||||||
|
|
||||||
[tool.mypy]
|
[tool.mypy]
|
||||||
ignore_missing_imports = true
|
ignore_missing_imports = true
|
||||||
|
|
||||||
|
[tool.flake8]
|
||||||
|
max-line-length = 120
|
||||||
Reference in New Issue
Block a user