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
46 changes: 38 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
name: Build & Upload Python Package to PyPI
name: Build & Deploy to PyPI

on:
workflow_dispatch:
inputs:
environment:
description: Deployment environment
required: true
type: choice
options:
- test
- production

release:
types: [ published ]
branches:
- main
types: [published]

jobs:
deploy:
Expand Down Expand Up @@ -43,9 +51,31 @@ jobs:
echo "Tag version: $TAG_VERSION"
uv version $TAG_VERSION

- name: Build and publish 🚀
env:
UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN }}
- 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
uv publish

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

- name: Commit documentation 📝
if: github.event_name == 'release' || inputs.environment == 'production'
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
47 changes: 0 additions & 47 deletions .github/workflows/deploy_to_test.yml

This file was deleted.

16 changes: 4 additions & 12 deletions .github/workflows/push_dev.yml → .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: Build & Test (side branches)
name: Build & Test

on:
push:
branches:
- "**"
- "!main"
branches-ignore:
- main

jobs:
build:
test:
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -39,10 +38,3 @@ jobs:
- name: Test with pytest ✅
run: |
uv run pytest tests

- name: Version replacement based on tag ↔️
if: github.ref_type == 'tag'
run: |
TAG_VERSION=${GITHUB_REF#refs/tags/}
echo "Tag version: $TAG_VERSION"
uv version $TAG_VERSION
35 changes: 0 additions & 35 deletions .github/workflows/push_main.yml

This file was deleted.