Skip to content

Commit

Permalink
chore: switch to poetry for packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
HADB committed Sep 11, 2024
1 parent 002ff81 commit 4c62af2
Show file tree
Hide file tree
Showing 5 changed files with 504 additions and 31 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,23 @@ jobs:
with:
python-version: 3

- name: Install poetry
run: |
pip install poetry
- name: Configure poetry
run: |
poetry config virtualenvs.in-project true
- name: Cache the virtualenv
uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
run: |
pip install hatch twine
poetry install
- name: Version tag and build
run: |
Expand All @@ -37,11 +51,10 @@ jobs:
NEW_TAG="$DATE.${TAG_NUMBER}"
git tag "$NEW_TAG"
git push origin "$NEW_TAG"
hatch version "$NEW_TAG"
hatch build
poetry version "$NEW_TAG"
poetry build
- name: Upload to PyPI
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: twine upload dist/*
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }}
run: poetry publish
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
## build && upload

```bash
$ hatch build
$ python3 -m twine upload dist/*
$ poetry build
$ poetry publish
```

## Config
Expand Down
Loading

0 comments on commit 4c62af2

Please sign in to comment.