Skip to content

Commit a1de6a8

Browse files
committed
ci: use the build package instead of setup.py
1 parent ead9615 commit a1de6a8

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed
Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This workflows will upload a Python Package using Twine when a release is created
22
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3-
3+
#
44
name: Upload Python Package
55

66
on:
@@ -13,18 +13,25 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@v3
16-
- name: Set up Python
17-
uses: actions/setup-python@v3
16+
- uses: actions/setup-python@v3
1817
with:
1918
python-version: "3.x"
20-
- name: Install dependencies
19+
20+
- name: install build package
2121
run: |
22-
python -m pip install --upgrade pip
23-
pip install setuptools wheel twine
24-
- name: Build and publish
22+
pip install --upgrade pip
23+
pip install build
24+
pip freeze
25+
26+
- name: build release
27+
run: |
28+
python -m build --sdist --wheel .
29+
ls -l dist
30+
31+
- name: Publish to PyPI
2532
env:
26-
TWINE_USERNAME: "__token__"
33+
TWINE_USERNAME: __token__
2734
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
2835
run: |
29-
python setup.py sdist bdist_wheel
30-
twine upload dist/*
36+
pip install twine
37+
twine upload --skip-existing dist/*

0 commit comments

Comments
 (0)