katzenpost_thin_client 0.0.21

This rust crate provides an async thin client library for Katzenpost, a post quantum decryption mixnet.
Documentation
# SPDX-FileCopyrightText: © 2026 David Stainton
# SPDX-License-Identifier: AGPL-3.0-only
#
# Builds the katzenpost_thinclient Python distribution and publishes
# it via PyPI's trusted-publishing flow (OIDC). No long-lived API
# tokens are stored anywhere; PyPI authenticates the workflow run by
# matching its OIDC claims against a publisher rule registered at
# https://pypi.org/manage/account/publishing/ for project
# "katzenpost-thinclient", repository "katzenpost/thin_client",
# workflow "publish-py.yml", and environment "pypi" (and "testpypi"
# on test.pypi.org).
#
# Release flow:
#   - bump version in pyproject.toml
#   - tag the commit "py/v<version>" and push the tag
#   - this workflow builds and publishes to PyPI
#
# Dry runs to TestPyPI are available via the "Run workflow" button
# in the Actions tab (workflow_dispatch).

name: Publish katzenpost_thinclient to PyPI

on:
  push:
    tags:
      - 'py/v*'
  workflow_dispatch:

jobs:
  build:
    name: Build sdist and wheel
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-python@v5
        with:
          python-version: '3.12'

      - name: Build distributions
        run: |
          python -m pip install --upgrade build
          python -m build

      - uses: actions/upload-artifact@v4
        with:
          name: python-package-distributions
          path: dist/

  smoke-test:
    name: Smoke-import the wheel before publish
    needs: build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-python@v5
        with:
          python-version: '3.12'

      - uses: actions/download-artifact@v4
        with:
          name: python-package-distributions
          path: dist/

      - name: Install wheel and import public modules
        run: |
          python -m venv /tmp/smoke
          WHEEL=$(echo dist/*.whl)
          /tmp/smoke/bin/pip install "${WHEEL}"
          /tmp/smoke/bin/python -c "
          import importlib.metadata
          import katzenpost_thinclient
          from katzenpost_thinclient import Config, ThinClient
          version = importlib.metadata.version('katzenpost_thinclient')
          assert version, 'katzenpost_thinclient version should be populated'
          print('smoke OK, version', version)
          "

  publish-testpypi:
    name: Publish to TestPyPI
    if: github.event_name == 'workflow_dispatch'
    needs: smoke-test
    runs-on: ubuntu-latest
    environment:
      name: testpypi
      url: https://test.pypi.org/p/katzenpost-thinclient
    permissions:
      id-token: write
    steps:
      - uses: actions/download-artifact@v4
        with:
          name: python-package-distributions
          path: dist/

      - uses: pypa/gh-action-pypi-publish@release/v1
        with:
          repository-url: https://test.pypi.org/legacy/

  publish-pypi:
    name: Publish to PyPI
    if: startsWith(github.ref, 'refs/tags/py/v')
    needs: smoke-test
    runs-on: ubuntu-latest
    environment:
      name: pypi
      url: https://pypi.org/p/katzenpost-thinclient
    permissions:
      id-token: write
    steps:
      - uses: actions/download-artifact@v4
        with:
          name: python-package-distributions
          path: dist/

      - uses: pypa/gh-action-pypi-publish@release/v1