Skip to content

Commit 667a324

Browse files
committed
Fixed yml file
1 parent 225cf92 commit 667a324

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/publish_to_pypi.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,19 @@ jobs:
3535
3636
- name: Fetch remote package version
3737
run: |
38-
packageRemoteVersion=$(python -c "exec(\"import pkg_resources\\ntry: print(pkg_resources.get_distribution('osw-incline').version)\\n except pkg_resources.DistributionNotFound: print('0.0.0');\")")
38+
packageRemoteVersion=$(python -c "exec(\"import pkg_resources\\n try: print(pkg_resources.get_distribution('osw-incline').version)\\n except pkg_resources.DistributionNotFound: print('0.0.0')\\n finally: print('Done checking version')\")")
3939
echo "remoteVersion=$packageRemoteVersion" >> $GITHUB_ENV
4040
4141
- name: Printing local and remote versions
4242
run: echo "Local version ${{env.localVersion}} and remote version ${{env.remoteVersion}}"
4343

44-
- name: Compare local and remote version with dpkg
45-
run: dpkg --compare-versions ${{env.localVersion}} "gt" ${{env.remoteVersion}}
44+
- name: Compare local and remote versions
45+
run: |
46+
echo "Comparing versions..."
47+
if dpkg --compare-versions ${{env.localVersion}} "le" ${{env.remoteVersion}}; then
48+
echo "The remote version (${{env.remoteVersion}}) is greater than or equal to the local version (${{env.localVersion}}). Aborting deployment."
49+
exit 1
50+
fi
4651
4752
4853
- name: Setup python wheel

0 commit comments

Comments
 (0)