Skip to content

Commit 0defda6

Browse files
authored
Update pipelines (#154)
1 parent c664cef commit 0defda6

File tree

3 files changed

+81
-33
lines changed

3 files changed

+81
-33
lines changed

.github/workflows/docs.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
tags:
6+
- "**"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Configure Git Credentials
18+
run: |
19+
git config user.name github-actions[bot]
20+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
21+
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v2
24+
with:
25+
version: "0.4.12"
26+
enable-cache: true
27+
28+
- name: Set up Python
29+
run: uv python install 3.12
30+
31+
- name: Install dependencies
32+
run: uv sync --frozen
33+
34+
- run: uv run mkdocs gh-deploy --force

.github/workflows/publish.yml

Lines changed: 46 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,59 @@
1-
# This workflow will upload a Python Package using Twine when a release is created
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3-
4-
# This workflow uses actions that are not certified by GitHub.
5-
# They are provided by a third-party and are governed by
6-
# separate terms of service, privacy policy, and support
7-
# documentation.
8-
9-
name: Upload Python Package
1+
name: Publish Python Package
102

113
on:
124
push:
135
tags:
14-
- '*'
15-
16-
permissions:
17-
contents: read
6+
- "**"
187

198
jobs:
20-
deploy:
9+
build:
2110
runs-on: ubuntu-latest
22-
11+
outputs:
12+
version: ${{ steps.inspect_package.outputs.version }}
2313
steps:
24-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v4
2515

26-
- name: Set up Python 3.10
27-
uses: actions/setup-python@v5
28-
with:
29-
python-version: "3.10"
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v2
18+
with:
19+
version: "0.4.12"
20+
enable-cache: true
21+
22+
- name: Set up Python
23+
run: uv python install 3.12
24+
25+
- name: Build package
26+
run: uv build
3027

31-
- name: Install dependencies
32-
run: |
33-
python -m pip install --upgrade pip
34-
pip install build
35-
pip install -e '.[docs]'
28+
- name: Inspect package version
29+
id: inspect_package
30+
run: |
31+
version=$(uvx hatchling version)
32+
echo "version=$version" >> "$GITHUB_OUTPUT"
3633
37-
- name: Build package
38-
run: python -m build
34+
- name: Upload package
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: package-distributions
38+
path: dist/
3939

40-
- name: Publish package
41-
uses: pypa/[email protected]
40+
pypi-publish:
41+
runs-on: ubuntu-latest
42+
needs: build
43+
44+
permissions:
45+
id-token: write
46+
47+
environment:
48+
name: pypi
49+
url: https://pypi.org/project/python-multipart/${{ needs.build.outputs.version }}
50+
51+
steps:
52+
- name: Download package
53+
uses: actions/download-artifact@v4
4254
with:
43-
user: __token__
44-
password: ${{ secrets.PYPI_API_TOKEN }}
45-
- name: Publish docs
46-
run: mkdocs gh-deploy --force
55+
name: package-distributions
56+
path: dist/
57+
58+
- name: Publish distribution 📦 to PyPI
59+
uses: pypa/gh-action-pypi-publish@release/v1

docs/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
multipart.fastapiexpert.com

0 commit comments

Comments
 (0)