Add Woodpecker CI pipeline with PyPI publishing #2

Closed
opened 2026-02-23 19:54:03 +00:00 by forgejo_admin · 0 comments

Context

pal-e-auth needs a Woodpecker CI pipeline that mirrors the GitHub Actions workflow used by ldraney/gcal-sdk for PyPI publishing, adapted for our self-hosted Forgejo + Woodpecker setup.

Requirements

Pipeline steps

  1. test — lint (ruff check/format) + pytest on every push and PR
  2. build-and-publish — on push to main only:
    • Extract version from pyproject.toml
    • Check if version already exists on PyPI (idempotent)
    • Build with hatchling (python -m build)
    • Publish to PyPI via twine (using API token from Woodpecker secrets)
    • Create Forgejo release via API

Woodpecker secrets needed

  • pypi_token — PyPI API token for uploading

Reference

  • gcal-sdk publish workflow: https://github.com/ldraney/gcal-sdk (.github/workflows/publish.yml)
  • Pattern: version check via curl to PyPI, build with hatchling, idempotent publish

Acceptance criteria

  • .woodpecker.yaml with test + publish steps
  • Tests pass in CI
  • Pushing a version bump to main publishes to PyPI
  • Re-pushing same version is a no-op (idempotent)
  • Forgejo release created on publish
## Context pal-e-auth needs a Woodpecker CI pipeline that mirrors the GitHub Actions workflow used by ldraney/gcal-sdk for PyPI publishing, adapted for our self-hosted Forgejo + Woodpecker setup. ## Requirements ### Pipeline steps 1. **test** — lint (ruff check/format) + pytest on every push and PR 2. **build-and-publish** — on push to main only: - Extract version from pyproject.toml - Check if version already exists on PyPI (idempotent) - Build with hatchling (`python -m build`) - Publish to PyPI via twine (using API token from Woodpecker secrets) - Create Forgejo release via API ### Woodpecker secrets needed - `pypi_token` — PyPI API token for uploading ### Reference - gcal-sdk publish workflow: https://github.com/ldraney/gcal-sdk (.github/workflows/publish.yml) - Pattern: version check via curl to PyPI, build with hatchling, idempotent publish ## Acceptance criteria - [ ] `.woodpecker.yaml` with test + publish steps - [ ] Tests pass in CI - [ ] Pushing a version bump to main publishes to PyPI - [ ] Re-pushing same version is a no-op (idempotent) - [ ] Forgejo release created on publish
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo_admin/pal-e-auth#2
No description provided.