File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 2020
2121 - uses : pdm-project/setup-pdm@v3
2222
23+ - name : Get current version from PyPI
24+ id : get_pypi_version
25+ run : |
26+ PACKAGE_NAME=$(pdm info | grep 'Name:' | awk '{print $2}')
27+ CURRENT_VERSION=$(pdm info | grep 'Version:' | awk '{print $2}')
28+ PYPI_VERSION=$(curl -s https://pypi.org/pypi/$PACKAGE_NAME/json | jq -r '.info.version')
29+ echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV
30+ echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
31+ echo "PYPI_VERSION=$PYPI_VERSION" >> $GITHUB_ENV
32+
33+ - name : Check if versions are different
34+ id : check_versions
35+ run : |
36+ if [ "$CURRENT_VERSION" != "$PYPI_VERSION" ]; then
37+ echo "versions_different=true" >> $GITHUB_ENV
38+ else
39+ echo "versions_different=false" >> $GITHUB_ENV
40+
2341 - name : Publish package distributions to PyPI
24- run : pdm publish
42+ run : pdm publish
You can’t perform that action at this time.
0 commit comments