Skip to content

Commit

Permalink
Update ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
SamirMoustafa authored Aug 11, 2024
1 parent 155041c commit f1d825a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,17 @@ jobs:
run: |
PACKAGE_NAME=$(python setup.py --name)
CURRENT_VERSION=$(python setup.py --version)
if ! twine upload --skip-existing dist/*; then
echo "Version does not exist on PyPI, proceeding with upload."
echo "exists=false" >> $GITHUB_ENV
else
echo "Version already exists on PyPI, skipping upload."
OUTPUT=$(twine check dist/*)
if ! echo "$OUTPUT" | grep -q 'PASSED'; then
echo "Check failed, not uploading"
echo "exists=true" >> $GITHUB_ENV
else
echo "Check passed, proceed with upload."
echo "exists=false" >> $GITHUB_ENV
fi
- name: Upload to PyPI
if: env.exists == 'false'
run: python -m twine upload dist/*
run: twine upload --skip-existing dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit f1d825a

Please sign in to comment.