File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6161 - name : Set up Python
6262 uses : actions/setup-python@v5
6363 with :
64- python-version : ' 3.11 '
64+ python-version : ' 3.10 '
6565
6666 - name : Install tools
6767 run : |
7979 run : |
8080 VERSION="${{ steps.get_version.outputs.version }}"
8181 PACKAGE="asrpy"
82- EXISTS=$(python -c "import json, urllib.request; versions = json.load(urllib.request.urlopen(f'https://pypi.org/pypi/{PACKAGE}/json'))['releases']; print('true' if '$VERSION' in versions else 'false')")
82+ EXISTS=$(python -c "import json, sys, urllib.request;
83+ package = sys.argv[1]
84+ version = sys.argv[2]
85+ versions = json.load(urllib.request.urlopen(f'https://pypi.org/pypi/{package}/json'))['releases']
86+ print('true' if version in versions else 'false')" "$PACKAGE" "$VERSION")
8387 echo "exists=$EXISTS" >> $GITHUB_OUTPUT
8488
89+
8590 - name : Stop if version already exists
8691 if : steps.check_version.outputs.exists == 'true'
8792 run : echo "Version already exists on PyPI — skipping publish."
You can’t perform that action at this time.
0 commit comments