Skip to content

Commit 8c3402d

Browse files
authored
Update publish.yaml with latest PyPI recommendations (#2516)
* Update `publish.yaml` with latest PyPI recommendations * Update .github/workflows/publish.yml * Simplify pipeline * Simplify pipeline * Use Python 3.12
1 parent 04c6320 commit 8c3402d

File tree

1 file changed

+72
-16
lines changed

1 file changed

+72
-16
lines changed

.github/workflows/publish.yml

Lines changed: 72 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,80 @@ on:
66
- '*'
77

88
jobs:
9-
publish:
10-
name: "Publish release"
11-
runs-on: "ubuntu-latest"
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.12"
18+
19+
- name: Install dependencies
20+
run: scripts/install
21+
22+
- name: Build package & docs
23+
run: scripts/build
24+
25+
- name: Upload package distributions
26+
uses: actions/upload-artifact@v2
27+
with:
28+
name: package-distributions
29+
path: dist/
30+
31+
- name: Upload documentation
32+
uses: actions/upload-artifact@v2
33+
with:
34+
name: documentation
35+
path: site/
36+
37+
pypi-publish:
38+
runs-on: ubuntu-latest
39+
needs: build
40+
41+
permissions:
42+
id-token: write
1243

1344
environment:
14-
name: deploy
45+
name: pypi
46+
url: https://pypi.org/project/uvicorn
1547

1648
steps:
17-
- uses: "actions/checkout@v4"
18-
- uses: "actions/setup-python@v5"
49+
- name: Download artifacts
50+
uses: actions/download-artifact@v2
1951
with:
20-
python-version: "3.8"
21-
- name: "Install dependencies"
22-
run: "scripts/install"
23-
- name: "Build package & docs"
24-
run: "scripts/build"
25-
- name: "Publish to PyPI & deploy docs"
26-
run: "scripts/publish"
27-
env:
28-
TWINE_USERNAME: __token__
29-
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
52+
name: package-distributions
53+
path: dist/
54+
55+
- name: Publish distribution 📦 to PyPI
56+
uses: pypa/gh-action-pypi-publish@release/v1
57+
58+
docs-publish:
59+
runs-on: ubuntu-latest
60+
needs: build
61+
62+
permissions:
63+
contents: write
64+
65+
steps:
66+
- name: Download artifacts
67+
uses: actions/download-artifact@v2
68+
with:
69+
name: documentation
70+
path: site/
71+
72+
- name: Configure Git Credentials
73+
run: |
74+
git config user.name github-actions[bot]
75+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
76+
77+
- uses: actions/setup-python@v5
78+
with:
79+
python-version: "3.12"
80+
81+
- name: Install dependencies
82+
run: scripts/install
83+
84+
- name: Publish documentation 📚 to GitHub Pages
85+
run: mkdocs gh-deploy --force

0 commit comments

Comments
 (0)