Skip to content

Commit 88e591b

Browse files
committed
Update publish workflow
1 parent e3f1e1f commit 88e591b

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

.github/workflows/publish.yaml

+27-6
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ on:
44
types: [published]
55

66
jobs:
7-
publish:
8-
runs-on: ubuntu-22.04
7+
build:
8+
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v4
1111
- uses: actions/setup-python@v5
@@ -16,8 +16,29 @@ jobs:
1616
run: |
1717
python -m pip install --upgrade build
1818
python -m build
19-
- name: Publish package to PyPI
20-
uses: pypa/gh-action-pypi-publish@release/v1
19+
- name: Store the distribution packages
20+
uses: actions/upload-artifact@v4
2121
with:
22-
user: __token__
23-
password: ${{ secrets.PYPI_API_TOKEN }}
22+
name: python-package-distributions
23+
path: dist/
24+
25+
publish-to-pypi:
26+
name: Publish to PyPI
27+
needs:
28+
- build
29+
runs-on: ubuntu-latest
30+
environment:
31+
name: pypi
32+
url: https://pypi.org/p/dacite
33+
permissions:
34+
id-token: write # IMPORTANT: mandatory for trusted publishing
35+
steps:
36+
- name: Download dist
37+
uses: actions/download-artifact@v4
38+
with:
39+
name: python-package-distributions
40+
path: dist/
41+
- name: Publish package to PyPI
42+
uses: pypa/gh-action-pypi-publish@release/v1
43+
with:
44+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)