From f83cf4ebc680b1909facc1994b8ba9913055820e Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Tue, 14 Feb 2023 13:41:33 -0600 Subject: [PATCH] Check wheel contents in workflow before publishing it to PyPI --- .github/workflows/publish.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2577fa20..c797b7bc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -33,7 +33,7 @@ jobs: - name: Install Dependencies run: | python -m pip install --upgrade pip - pip install build twine + pip install build twine check-wheel-contents - name: Install Application run: | @@ -49,10 +49,15 @@ jobs: export PYTHONHASHSEED=42 export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) - # Build and Upload PyPi Package + # Build PyPi Package rm -rf dist python -m build + + # Validate PyPi Package + check-wheel-contents dist/*.whl twine check dist/* + + # Upload PyPi Package twine upload --verbose dist/* - name: Publish Master to PyPI @@ -68,10 +73,15 @@ jobs: export PYTHONHASHSEED=42 export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) - # Build and Upload PyPi Package + # Build PyPi Package rm -rf dist python -m build + + # Validate PyPi Package + check-wheel-contents dist/*.whl twine check dist/* + + # Upload PyPi Package twine upload --verbose dist/* - name: Publish Repo PR to Test PyPI @@ -88,8 +98,13 @@ jobs: export PYTHONHASHSEED=42 export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) - # Build and Upload PyPi Package + # Build PyPi Package rm -rf dist python -m build + + # Validate PyPi Package + check-wheel-contents dist/*.whl twine check dist/* + + # Upload PyPi Package twine upload -r testpypi --verbose dist/* \ No newline at end of file