Skip to content

Commit 7b9270d

Browse files
committed
upgrade publish: use hatchling to build, publish using pypa gh-action
1 parent 49e1e12 commit 7b9270d

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

.github/workflows/python-publish.yml

+17-14
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,27 @@ permissions:
1616
contents: read
1717

1818
jobs:
19-
deploy:
19+
pypi-publish:
2020

2121
runs-on: ubuntu-latest
2222

2323
steps:
24-
- uses: actions/checkout@v3
25-
- name: Set up Python
24+
- name: Set up Python 🐍
2625
uses: actions/setup-python@v3
2726
with:
2827
python-version: '3.x'
29-
- name: Install dependencies
30-
run: |
31-
python -m pip install --upgrade pip
32-
pip install setuptools wheel twine
33-
- name: Build and publish
34-
env:
35-
TWINE_USERNAME: __token__
36-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
37-
run: |
38-
python setup.py sdist bdist_wheel
39-
twine upload dist/*
28+
29+
- name: Install Hatch 🐣
30+
run: pip install --upgrade pip "hatch==1.7.0"
31+
32+
- name: Build 🔨
33+
run: hatch build
34+
35+
- name: Publish package 🚀
36+
uses: pypa/gh-action-pypi-publish@v1.8.6
37+
with:
38+
repository-url: https://pypi.org/project/FastAPI-JSONAPI/
39+
password: ${{ secrets.PYPI_PASSWORD }}
40+
41+
# fail loudly on duplicates
42+
# skip-existing: true

0 commit comments

Comments
 (0)