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
334 changes: 0 additions & 334 deletions .env.example

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ jobs:
- name: Install build dependencies
run: |
uv sync --dev
uv pip install build twine
uv pip install twine

- name: Build package
run: |
uv run python -m build
uv build

- name: Check package
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CI/CD Pipeline

on:
push:
branches: [ main, develop ]
branches: [ main, dev ]
pull_request:
branches: [ main, develop ]
branches: [ main, dev ]

jobs:
test:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ on:
paths:
- 'docs/**'
- 'dev/mkdocs.yml'
- '.readthedocs.yaml'
- 'dev/requirements-rtd.txt'
- 'ccbt/**'
pull_request:
branches: [main, dev]
paths:
- 'docs/**'
- 'dev/mkdocs.yml'
- '.readthedocs.yaml'
- 'dev/requirements-rtd.txt'

jobs:
build-docs:
Expand Down
102 changes: 102 additions & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Publish to PyPI

on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version to publish (e.g., 0.1.0)'
required: false
type: string

jobs:
publish:
name: publish-to-pypi
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install UV
uses: astral-sh/setup-uv@v4
with:
version: "latest"

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install project dependencies
run: |
uv sync --dev

- name: Build package with uv
run: |
uv build

- name: Verify package files
run: |
echo "📦 Built package files:"
ls -lh dist/
echo ""
echo "📋 Package contents:"
uv run twine check dist/* || echo "⚠️ twine not available, skipping check"

- name: Publish to PyPI
env:
UV_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
if [ -z "$UV_PYPI_TOKEN" ]; then
echo "❌ Error: PYPI_API_TOKEN secret is not set"
echo "Please add your PyPI API token as a GitHub secret named 'PYPI_API_TOKEN'"
exit 1
fi

echo "🚀 Publishing to PyPI..."
uv publish

echo "✅ Successfully published to PyPI!"
echo "📦 Package: https://pypi.org/project/ccbt/"

- name: Extract version
id: get_version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ github.event.inputs.version }}" ]; then
VERSION="${{ github.event.inputs.version }}"
else
VERSION=${GITHUB_REF#refs/tags/v}
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Published version: $VERSION"

- name: Verify publication
run: |
echo "⏳ Waiting 10 seconds for PyPI to propagate..."
sleep 10

VERSION="${{ steps.get_version.outputs.version }}"
echo "🔍 Verifying package is available on PyPI..."

# Try to check if package is available (non-blocking)
pip install --upgrade pip || true
pip index versions ccbt 2>/dev/null | grep -q "$VERSION" && echo "✅ Version $VERSION found on PyPI!" || echo "⚠️ Version may not be immediately available"

- name: Publish summary
run: |
VERSION="${{ steps.get_version.outputs.version }}"
echo "## ✅ PyPI Publication Complete" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Version:** v$VERSION" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Package Links:**" >> $GITHUB_STEP_SUMMARY
echo "- PyPI: https://pypi.org/project/ccbt/" >> $GITHUB_STEP_SUMMARY
echo "- Installation: \`uv pip install ccbt==$VERSION\`" >> $GITHUB_STEP_SUMMARY

2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:

- name: Build package
run: |
uv run python -m build
uv build

- name: Validate package
run: |
Expand Down
35 changes: 35 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
#
# Note: This file must be in the root directory (Read the Docs requirement)
# but references dev/mkdocs.yml for the MkDocs configuration

version: 2

# Build configuration
build:
os: ubuntu-24.04
tools:
python: "3.11"

# MkDocs configuration
# Point to the mkdocs.yml file in the dev directory
mkdocs:
configuration: dev/mkdocs.yml

# Python environment configuration
python:
install:
# Install dependencies from requirements file
- requirements: dev/requirements-rtd.txt
# Install the project itself (needed for mkdocstrings to parse code)
# Use editable install to ensure imports work correctly
- method: pip
path: .
extra_requirements: []

# Format configuration (optional, for better build output)
formats:
- htmlzip
- pdf

Loading
Loading