From 16a57b5843e84c922ce920d7f1f8d74593dcd93a Mon Sep 17 00:00:00 2001 From: soustruh Date: Wed, 21 Jan 2026 17:36:55 +0100 Subject: [PATCH 1/2] Revert "checkout main before docs commit to avoid detached HEAD push failure" This reverts commit 158fbe3323aa4a58814d6b1ff18542cca0ef67f1. --- .github/workflows/deploy.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4936b1a..bb83add 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -74,13 +74,8 @@ jobs: if: github.event_name == 'release' || inputs.environment == 'production' 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 + git push From 4f76275998bba8c5b0eec44d24007d67a7be7f62 Mon Sep 17 00:00:00 2001 From: soustruh Date: Thu, 22 Jan 2026 09:03:10 +0100 Subject: [PATCH 2/2] =?UTF-8?q?generate=20docs=20manually=20and=20release?= =?UTF-8?q?=20to=20both=20TestPyPI=20&=20PyPI=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 39 +++++++++-------------------- .github/workflows/generate-docs.yml | 38 ++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/generate-docs.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index bb83add..91052b3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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] @@ -51,31 +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/} - 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 + uv publish diff --git a/.github/workflows/generate-docs.yml b/.github/workflows/generate-docs.yml new file mode 100644 index 0000000..cb7dbac --- /dev/null +++ b/.github/workflows/generate-docs.yml @@ -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