Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 12 additions & 32 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ name: Build & Deploy to PyPI
on:
workflow_dispatch:
inputs:
environment:
description: Deployment environment
required: true
type: choice
options:
- test
- production
note:
description: 'This workflow publishes to TestPyPI only. For production, create a GitHub Release.'
required: false
default: ""

release:
types: [published]
Expand Down Expand Up @@ -51,36 +48,19 @@ jobs:
echo "Tag version: $TAG_VERSION"
uv version $TAG_VERSION

- name: Generate HTML documentation 📚
if: github.event_name == 'release' || inputs.environment == 'production'
run: |
uv sync --all-groups --frozen
uv pip install -e .
uv run pdoc --html -f -o ./docs keboola.component
mv ./docs/keboola/component/* docs
rm -r ./docs/keboola

- name: Build package 📦
run: |
uv build

- name: Publish to PyPI 🚀
- name: Publish to TestPyPI 🧪
env:
UV_PUBLISH_TOKEN: ${{ inputs.environment == 'test' && secrets.UV_PUBLISH_TOKEN_TEST_PYPI || secrets.UV_PUBLISH_TOKEN }}
UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN_TEST_PYPI }}
run: |
uv publish ${{ inputs.environment == 'test' && '--index testpypi' || '' }}
uv publish --index testpypi

- name: Commit documentation 📝
if: github.event_name == 'release' || inputs.environment == 'production'
- name: Publish to PyPI 🚀
if: github.event_name == 'release'
env:
UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN }}
run: |
TAG_VERSION=${GITHUB_REF#refs/tags/}

# Checkout main before docs commit to avoid detached HEAD push failure
git fetch origin main
git checkout main

git config --global user.name 'KCF'
git config --global user.email 'kcf@users.noreply.github.com'
git add docs
git commit -m "docs: update for release $TAG_VERSION 📚" || echo "No changes to commit"
git push origin main
uv publish
38 changes: 38 additions & 0 deletions .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Generate Documentation

on:
workflow_dispatch:

jobs:
generate-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛒
uses: actions/checkout@v4

- name: Install uv 💜
uses: astral-sh/setup-uv@v6

- name: Set up Python 🐍
uses: actions/setup-python@v4
with:
python-version: "3.13"

- name: Install dependencies 📦
run: |
uv sync --all-groups --frozen

- name: Generate HTML documentation 📚
run: |
uv pip install -e .
uv run pdoc --html -f -o ./docs keboola.component
mv ./docs/keboola/component/* docs
rm -r ./docs/keboola

- name: Commit documentation 📝
run: |
git config --global user.name 'KCF'
git config --global user.email 'kcf@users.noreply.github.com'
git add docs
git commit -m "docs: update documentation 📚" || echo "No changes to commit"
git push