Skip to content

Commit dba30ba

Browse files
committed
📦👷 Use hynek/build-and-inspect-python-package for building python packages
1 parent ed14f28 commit dba30ba

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

‎project_name/.github/workflows/{% if in_pypi %}build-and-publish.yml{% endif %}.jinja‎

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,18 @@ jobs:
1717
ci:
1818
uses: ./.github/workflows/ci.yml
1919

20-
build:
20+
build-and-inspect-package:
2121
needs: ci
2222
runs-on: ubuntu-latest
2323
steps:
2424
- uses: actions/checkout@v5
2525
with:
2626
persist-credentials: false
27-
- uses: astral-sh/setup-uv@v6
28-
- name: Build package
29-
run: uv build
30-
- name: Upload package distributions
31-
uses: actions/upload-artifact@v4
32-
with:
33-
name: python-package-distributions
34-
path: dist/
27+
- uses: hynek/build-and-inspect-python-package@v2
3528

3629
publish-to-testpypi:
3730
if: github.event_name == 'push'
38-
needs: build
31+
needs: build-and-inspect-package
3932
runs-on: ubuntu-latest
4033
environment:
4134
name: testpypi
@@ -48,7 +41,7 @@ jobs:
4841
- name: Download package distributions
4942
uses: actions/download-artifact@v5
5043
with:
51-
name: python-package-distributions
44+
name: Packages
5245
path: dist/
5346
- name: Publish distribution to TestPyPI
5447
uses: pypa/gh-action-pypi-publish@release/v1
@@ -57,7 +50,7 @@ jobs:
5750

5851
publish-to-pypi:
5952
if: github.event_name == 'release'
60-
needs: build
53+
needs: build-and-inspect-package
6154
runs-on: ubuntu-latest
6255
environment:
6356
name: pypi
@@ -70,7 +63,7 @@ jobs:
7063
- name: Download package distributions
7164
uses: actions/download-artifact@v5
7265
with:
73-
name: python-package-distributions
66+
name: Packages
7467
path: dist/
7568
- name: Publish distribution to PyPI
7669
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)