Skip to content

Commit

Permalink
ci: fgracefully handle no package to publish
Browse files Browse the repository at this point in the history
  • Loading branch information
thompsonson committed Sep 26, 2024
1 parent e260e8e commit dc6d7f9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,13 @@ jobs:
echo "versioning and publishing the package"
poetry config pypi-token.pypi $PYPI_TOKEN
poetry run semantic-release version
poetry publish --skip-existing
# Build the package if semantic-release has created a new version
poetry build
# Check if there are any files to publish before running poetry publish
if [ "$(ls -A dist)" ]; then
echo "Publishing to PyPI..."
poetry publish --skip-existing
else
echo "No files to publish. Skipping poetry publish."
fi

0 comments on commit dc6d7f9

Please sign in to comment.