Skip to content

Commit

Permalink
update .github/workflows/pypi-release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Dec 13, 2024
1 parent 1873e3c commit 2563f9a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ jobs:
uses: actions/checkout@v4
- name: Create release
run: |
VERSION=$(./scripts/version-core)
if pip index versions pyglossary --pre | grep "$VERSION," ; then
echo 'Package version $VERSION already exists on pypi'
exit 0
fi
sudo rm -rf dist/* build/* || true
python3 setup.py sdist bdist_wheel
- name: Publish package distributions to PyPI
Expand Down
11 changes: 11 additions & 0 deletions scripts/version-core
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -e

sourceDir=$(dirname $(dirname "$0"))

while read -r line; do
if [[ $line = VERSION* ]]; then
echo "$line" | sed 's/VERSION\s*=\s*//' | sed 's/"//g'
exit 0
fi
done <"$sourceDir/pyglossary/core.py"

0 comments on commit 2563f9a

Please sign in to comment.