Skip to content

Commit

Permalink
make it check for new python version
Browse files Browse the repository at this point in the history
Koeng101 committed Aug 12, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 4fb1185 commit 56f2383
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -142,9 +142,20 @@ jobs:
- name: List directory structure
run: find dist -type f

- name: Publish to PyPI
- name: Check version and publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload dist/**/*.whl
# Get the version from the wheel file name
WHEEL_FILE=$(find dist -name "*.whl" | head -n 1)
VERSION=$(echo $WHEEL_FILE | sed -E 's/.*dnadesign-([0-9]+\.[0-9]+\.[0-9]+).*/\1/')
echo "Package version: $VERSION"
# Check if the version exists on PyPI
if ! pip index versions dnadesign | grep -q "$VERSION"; then
echo "Version $VERSION not found on PyPI. Uploading..."
twine upload dist/**/*.whl
else
echo "Version $VERSION already exists on PyPI. Skipping upload."
fi

0 comments on commit 56f2383

Please sign in to comment.