Skip to content

Commit 1cdc9e1

Browse files
authored
Use trusted publishing for package uploads (#45)
* Use trusted publishing for package uploads
1 parent e3f944f commit 1cdc9e1

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

.github/workflows/publish.yml

+24-8
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,39 @@ on:
55
types: [created]
66

77
jobs:
8-
deploy:
8+
build:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v4
12-
- name: Set up Python 3.8
12+
- name: Set up Python 3.9
1313
uses: actions/setup-python@v5
1414
with:
15-
python-version: 3.8
15+
python-version: 3.9
1616
- name: Install build dependencies
1717
run: |
1818
python -m pip install --upgrade pip wheel build
1919
- name: Build package
2020
run: |
2121
python -m build
22-
- name: Publish a Python distribution to PyPI
23-
uses: pypa/[email protected]
22+
- name: Upload Artifact
23+
uses: actions/upload-artifact@v4
2424
with:
25-
user: __token__
26-
password: ${{ secrets.PYPI_UPLOAD_API_TOKEN }}
27-
25+
name: docstring-to-markdown dist ${{ github.run_number }}
26+
path: ./dist
27+
pypi-publish:
28+
name: Upload release to PyPI
29+
runs-on: ubuntu-latest
30+
needs: [build]
31+
environment:
32+
name: pypi
33+
url: https://pypi.org/p/docstring-to-markdown
34+
permissions:
35+
id-token: write
36+
steps:
37+
- name: Download artifacts
38+
uses: actions/download-artifact@v4
39+
with:
40+
name: docstring-to-markdown dist ${{ github.run_number }}
41+
path: ./dist
42+
- name: Publish package distributions to PyPI
43+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)