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