Skip to content

Bulk asynchronous downloader for multiple file hosts

Update publish-to-pypi.yaml

Jacobf5b9c73bc1fb
diff --git a/.github/workflows/publish-to-pypi.yaml b/.github/workflows/publish-to-pypi.yaml
index e60995db1..49b92ccb5 100644
--- a/.github/workflows/publish-to-pypi.yaml
+++ b/.github/workflows/publish-to-pypi.yaml
@@ -34,8 +34,18 @@ jobs:
exit 0
fi
+ - name: Check if Tag Exists
+ id: tag_exists
+ run: |
+ if git rev-parse "refs/tags/${{ env.version }}" >/dev/null 2>&1; then
+ echo "Tag ${{ env.version }} already exists."
+ echo "tag_exists=true" >> $GITHUB_ENV
+ else
+ echo "tag_exists=false" >> $GITHUB_ENV
+ fi
+
- name: Create Tag
- if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && env.version != '' }}
+ if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && env.tag_exists == 'false' }}
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
@@ -46,7 +56,7 @@ jobs:
if: ${{ github.ref == 'refs/heads/master' && env.version != '' }}
run: |
git fetch --tags
- git checkout "refs/tags/${{ env.version }}" # Checkout the newly created tag
+ git checkout "refs/tags/${{ env.version }}"
echo "Checked out tag ${{ env.version }}"
- name: Build project for distribution