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
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
- name: Install just
uses: extractions/setup-just@v2

- name: Sync dependencies
run: uv sync --all-extras --all-packages

- name: Detect package changes
id: changes
run: |
Expand Down
78 changes: 78 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches:
- main

permissions:
contents: read
pull-requests: write

jobs:
validate-commits:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -54,3 +58,77 @@ jobs:

- name: Run tests
run: just test

release-preview:
runs-on: ubuntu-latest
needs: [validate-commits, lint-and-test]
if: github.event_name == 'pull_request'

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

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Install just
uses: extractions/setup-just@v2

- name: Install dependencies
run: uv sync --all-extras

- name: Generate release preview
id: release-preview
run: |
# Get version preview information using the Python script
version_preview=$(uv run python scripts/version_preview.py --format github-summary)

echo "preview<<EOF" >> $GITHUB_OUTPUT
echo "$version_preview" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

# Check if there are any changes by looking for version information
changes=$(uv run python scripts/version_preview.py --format json)
if [ "$changes" = "[]" ] || [ -z "$changes" ]; then
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "has_changes=true" >> $GITHUB_OUTPUT
fi

- name: Display release preview
if: steps.release-preview.outputs.has_changes == 'true'
run: |
# Use cat with here document to safely handle special characters
cat >> $GITHUB_STEP_SUMMARY << 'EOF'
${{ steps.release-preview.outputs.preview }}

### 📝 Changelog Preview

```
EOF
just preview-changelog >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY

- name: No release preview
if: steps.release-preview.outputs.has_changes == 'false'
run: |
# Use cat with here document to safely handle special characters
cat >> $GITHUB_STEP_SUMMARY << 'EOF'
${{ steps.release-preview.outputs.preview }}
EOF

- name: Comment on PR with release preview
if: github.event_name == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.number }}
run: |
uv run python scripts/pr_comment.py
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ jobs:
uses: astral-sh/setup-uv@v4

- name: Install dependencies
run: uv sync --all-extras
run: uv sync --all-extras --all-packages

- name: Build package
run: |
uv build --package ${PACKAGE}

- name: Publish to PyPI
run: |
uv publish
uv publish --index testpypi
9 changes: 9 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Setup development environment
dev-setup:
uv run pre-commit install
uv sync --all-extras --all-packages

# Build the project
build:
uv sync --all-packages
Expand Down Expand Up @@ -53,6 +58,10 @@ preview-changelog BASE_BRANCH="origin/main":
changelog-preview BASE_BRANCH="origin/main":
uv run python scripts/changelog.py preview {{BASE_BRANCH}}

# Preview expected version changes for packages with unreleased changes
preview-versions FORMAT="markdown":
uv run python scripts/version_preview.py --format {{FORMAT}}

# Detect packages with unreleased changes
detect-changes:
uv run python scripts/changelog.py changes --output-format github
Expand Down
6 changes: 6 additions & 0 deletions packages/mcp-fastmcp/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ vcs = "git"
pattern = "(?P<base>\\d+\\.\\d+\\.\\d+)-keycardai-mcp-fastmcp"
style = "pep440"

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.hatch.build.targets.wheel]
packages = ["src/keycardai"]

Expand Down
6 changes: 6 additions & 0 deletions packages/mcp/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ vcs = "git"
pattern = "(?P<base>\\d+\\.\\d+\\.\\d+)-keycardai-mcp"
style = "pep440"

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.hatch.build.targets.wheel]
packages = ["src/keycardai"]

Expand Down
6 changes: 6 additions & 0 deletions packages/oauth/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ vcs = "git"
pattern = "(?P<base>\\d+\\.\\d+\\.\\d+)-keycardai-oauth"
style = "pep440"

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.hatch.build.targets.wheel]
packages = ["src/keycardai"]

Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ keywords = ["keycard", "oauth", "authentication", "security", "api"]

# This is a namespace/workspace root package with no source code
# All functionality is provided by workspace member packages
dependencies = [
"pre-commit>=4.3.0",
]
dependencies = []

# Optional dependencies for development
[project.optional-dependencies]
Expand All @@ -38,6 +36,8 @@ dev = [
"isort>=5.13.2",
"mypy>=1.14.1",
"ruff>=0.12.10",
"pre-commit>=4.3.0",
"commitizen>=3.29.0",
]

[project.urls]
Expand Down Expand Up @@ -94,6 +94,8 @@ dev = [
"pytest>=8.4.1",
"pytest-asyncio>=1.1.0",
"ruff>=0.12.10",
"pre-commit>=4.3.0",
"commitizen>=3.29.0",
]

# Configure as a namespace/workspace root package
Expand Down
Loading