Skip to content

Commit 6204f4b

Browse files
authored
Update python-publish.yml
1 parent 2bc8639 commit 6204f4b

1 file changed

Lines changed: 22 additions & 19 deletions

File tree

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

63
on:
@@ -14,19 +11,25 @@ jobs:
1411
deploy:
1512
runs-on: ubuntu-latest
1613
steps:
17-
- uses: actions/checkout@v4
18-
- name: Set up Python
19-
uses: actions/setup-python@v5
20-
with:
21-
python-version: '3.x'
22-
- name: Install dependencies
23-
run: |
24-
python -m pip install --upgrade pip
25-
pip install build
26-
- name: Build package
27-
run: python -m build
28-
- name: Publish package
29-
uses: pypa/gh-action-pypi-publish@7eb3b701d11256e583f5b49899c5e7203deab573
30-
with:
31-
user: __token__
32-
password: ${{ secrets.PYPI_API_TOKEN }}
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0 # fetch all history & tags so setuptools_scm can infer the version
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.x'
22+
23+
- name: Install build tools
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install build
27+
28+
- name: Build package
29+
run: python -m build
30+
31+
- name: Publish package
32+
uses: pypa/gh-action-pypi-publish@7eb3b701d11256e583f5b49899c5e7203deab573
33+
with:
34+
user: __token__
35+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)