Skip to content

Commit

Permalink
Use poetry instead of flit for publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-nameless committed Apr 23, 2021
1 parent 81d5cc0 commit 45ab2e6
Show file tree
Hide file tree
Showing 5 changed files with 348 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- name: Install tools
run: |
pip install black==20.8b1 mypy==0.812 isort==5.6.2 flake8==3.8.4
pip install poetry && poetry install
- name: Check formatting and run linters
run: |
Expand Down
7 changes: 4 additions & 3 deletions make → do
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,20 @@ case $ARG in
;;

release)
# CURRENT_VERSION=$(cat tg/__init__.py | grep version | cut -d '"' -f 2)
CURRENT_VERSION=$(python3 -c 'import tg; print(tg.__version__, end="")')
CURRENT_VERSION=$(cat tg/__init__.py | grep version | cut -d '"' -f 2)
echo Current version $CURRENT_VERSION

NEW_VERSION=$(echo $CURRENT_VERSION | awk -F. '{print $1 "." $2+1 "." $3}')
echo New version $NEW_VERSION
sed -i '' "s|$CURRENT_VERSION|$NEW_VERSION|g" tg/__init__.py
poetry version $NEW_VERSION

git add -u tg/__init__.py
git commit -m "Release v$NEW_VERSION"
git tag v$NEW_VERSION

flit publish
poetry build
poetry publish -u $(pass show i/pypi | grep username | cut -d ' ' -f 2 | tr -d '\n') -p $(pass show i/pypi | head -n 1 | tr -d '\n')
git log --pretty=format:"%cn: %s" v$CURRENT_VERSION...v$NEW_VERSION | grep -v -e "Merge" | grep -v "Release"| awk '!x[$0]++' > changelog.md
git push origin master --tags
gh release create v$NEW_VERSION -F changelog.md
Expand Down
Loading

0 comments on commit 45ab2e6

Please sign in to comment.