Skip to content

Commit 7c3ad37

Browse files
committed
generate docs manually and release to both TestPyPI & PyPI 🚀
1 parent 16a57b5 commit 7c3ad37

File tree

2 files changed

+50
-27
lines changed

2 files changed

+50
-27
lines changed

.github/workflows/deploy.yml

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@ name: Build & Deploy to PyPI
33
on:
44
workflow_dispatch:
55
inputs:
6-
environment:
7-
description: Deployment environment
8-
required: true
9-
type: choice
10-
options:
11-
- test
12-
- production
6+
note:
7+
description: 'This workflow publishes to TestPyPI only. For production, create a GitHub Release.'
8+
required: false
9+
default: ''
1310

1411
release:
1512
types: [published]
@@ -51,31 +48,19 @@ jobs:
5148
echo "Tag version: $TAG_VERSION"
5249
uv version $TAG_VERSION
5350
54-
- name: Generate HTML documentation 📚
55-
if: github.event_name == 'release' || inputs.environment == 'production'
56-
run: |
57-
uv sync --all-groups --frozen
58-
uv pip install -e .
59-
uv run pdoc --html -f -o ./docs keboola.component
60-
mv ./docs/keboola/component/* docs
61-
rm -r ./docs/keboola
62-
6351
- name: Build package 📦
6452
run: |
6553
uv build
6654
67-
- name: Publish to PyPI 🚀
55+
- name: Publish to TestPyPI 🧪
6856
env:
69-
UV_PUBLISH_TOKEN: ${{ inputs.environment == 'test' && secrets.UV_PUBLISH_TOKEN_TEST_PYPI || secrets.UV_PUBLISH_TOKEN }}
57+
UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN_TEST_PYPI }}
7058
run: |
71-
uv publish ${{ inputs.environment == 'test' && '--index testpypi' || '' }}
59+
uv publish --index testpypi
7260
73-
- name: Commit documentation 📝
74-
if: github.event_name == 'release' || inputs.environment == 'production'
61+
- name: Publish to PyPI 🚀
62+
if: github.event_name == 'release'
63+
env:
64+
UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN }}
7565
run: |
76-
TAG_VERSION=${GITHUB_REF#refs/tags/}
77-
git config --global user.name 'KCF'
78-
git config --global user.email 'kcf@users.noreply.github.com'
79-
git add docs
80-
git commit -m "docs: update for release $TAG_VERSION 📚" || echo "No changes to commit"
81-
git push
66+
uv publish
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Generate Documentation
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
generate-docs:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout 🛒
11+
uses: actions/checkout@v4
12+
13+
- name: Install uv 💜
14+
uses: astral-sh/setup-uv@v6
15+
16+
- name: Set up Python 🐍
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: "3.13"
20+
21+
- name: Install dependencies 📦
22+
run: |
23+
uv sync --all-groups --frozen
24+
25+
- name: Generate HTML documentation 📚
26+
run: |
27+
uv pip install -e .
28+
uv run pdoc --html -f -o ./docs keboola.component
29+
mv ./docs/keboola/component/* docs
30+
rm -r ./docs/keboola
31+
32+
- name: Commit documentation 📝
33+
run: |
34+
git config --global user.name 'KCF'
35+
git config --global user.email 'kcf@users.noreply.github.com'
36+
git add docs
37+
git commit -m "docs: update documentation 📚" || echo "No changes to commit"
38+
git push

0 commit comments

Comments
 (0)