Skip to content

Commit

Permalink
update script
Browse files Browse the repository at this point in the history
  • Loading branch information
luyaxi committed Aug 20, 2024
1 parent 6e77dcc commit 357bc2a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ jobs:
- name: Check if version exists on PyPI
id: check_version
run: |
if curl -s https://pypi.org/pypi/codelinker/$VERSION/json; then
response=$(curl -s https://pypi.org/pypi/codelinker/$VERSION/json)
if echo "$response" | grep -q 'Not Found'; then
echo "Version $VERSION does not exist on PyPI. Proceeding with publish."
echo "exists=false" >> $GITHUB_ENV
else
echo "Version $VERSION already exists on PyPI. Skipping publish."
echo "exists=true" >> $GITHUB_ENV
else
echo "exists=false" >> $GITHUB_ENV
fi
- name: Build and publish
if: env.exists == 'false'
Expand Down

0 comments on commit 357bc2a

Please sign in to comment.