cyrusyc commited on
Commit
fdd1450
·
1 Parent(s): 090f728
Files changed (1) hide show
  1. .github/workflows/release.yaml +7 -6
.github/workflows/release.yaml CHANGED
@@ -91,12 +91,13 @@ jobs:
91
  VERSION=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['version'])")
92
  echo "VERSION=$VERSION" >> $GITHUB_ENV
93
 
94
- # Step 5: Get the latest Git tag
95
- - name: Get latest tag
96
- id: get_latest_tag
97
- run: |
98
- LATEST_TAG=$(git describe --tags --abbrev=0)
99
- echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
 
100
 
101
  # Step 6: Compare current version with the latest tag
102
  - name: Check if version is bumped
 
91
  VERSION=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['version'])")
92
  echo "VERSION=$VERSION" >> $GITHUB_ENV
93
 
94
+ # Step 5: Get latest version from PyPI
95
+ - name: Get latest version from PyPI
96
+ id: get_pypi_version
97
+ run: |
98
+ PACKAGE_NAME=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['name'])")
99
+ LATEST_PYPI_VERSION=$(python -c "import requests; response = requests.get(f'https://pypi.org/pypi/{PACKAGE_NAME}/json'); print(response.json()['info']['version'])")
100
+ echo "LATEST_PYPI_VERSION=$LATEST_PYPI_VERSION" >> $GITHUB_ENV
101
 
102
  # Step 6: Compare current version with the latest tag
103
  - name: Check if version is bumped