Skip to content

Commit 4fc60d8

Browse files
RobThePCGuyclaude
andcommitted
chore: add comprehensive CI/CD workflows and repository best practices
Add GitHub Actions workflows for automated testing, linting, security scanning, and releases. Configure repository labels and tooling for improved code quality and collaboration. Added: - GitHub Actions workflows (test, lint, release) - CHANGELOG.md for version tracking - .typos.toml for spell checking configuration - .github/labels.json with 22 standardized labels - .github/FUNDING.yml for sponsorship support Enhanced: - pyproject.toml with comprehensive tool configurations - Ruff linting rules - Black and isort settings - mypy type checking - pytest and coverage configuration - Bandit security settings Removed: - docs/GITHUB_QUICK_START.md (consolidated) - docs/GITHUB_SETUP.md (consolidated) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent faa42b0 commit 4fc60d8

File tree

10 files changed

+765
-815
lines changed

10 files changed

+765
-815
lines changed

.github/FUNDING.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Funding options for Utility Patent Reviewer
2+
#
3+
# This file specifies funding platforms that will be displayed on the
4+
# repository sidebar to support the project's development.
5+
#
6+
# For more information, see: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository
7+
8+
# GitHub Sponsors
9+
# Replace with your GitHub username to enable GitHub Sponsors
10+
github: RobThePCGuy
11+
12+
# Alternative funding platforms
13+
# Replace with your usernames on each platform (remove # to enable)
14+
15+
# Patreon
16+
# patreon: username
17+
18+
# Open Collective
19+
# open_collective: username
20+
21+
# Ko-fi
22+
# ko_fi: username
23+
24+
# Buy Me a Coffee
25+
# custom: https://www.buymeacoffee.com/username
26+
27+
# PayPal
28+
custom: https://paypal.me/robthepcguy
29+
30+
31+
# Crypto (if you accept cryptocurrency donations)
32+
# custom: [
33+
# "https://etherscan.io/address/YOUR_ETH_ADDRESS",
34+
# "Bitcoin: YOUR_BTC_ADDRESS"
35+
# ]
36+
37+
# ============================================================================
38+
# Instructions:
39+
# ============================================================================
40+
#
41+
# 1. Uncomment (remove #) from the platforms you want to enable
42+
# 2. Replace 'username' or URLs with your actual account information
43+
# 3. Commit and push this file to make the sponsor button visible
44+
# 4. The sponsor button will appear in the repository sidebar
45+
#
46+
# Example for GitHub Sponsors:
47+
# github: RobThePCGuy
48+
#
49+
# Example for Buy Me a Coffee:
50+
# custom: https://www.buymeacoffee.com/robthepcguy
51+
#
52+
# Note: If you don't want to accept donations, you can delete this file.

.github/labels.json

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
[
2+
{
3+
"name": "bug",
4+
"description": "Something isn't working",
5+
"color": "d73a4a"
6+
},
7+
{
8+
"name": "enhancement",
9+
"description": "New feature or request",
10+
"color": "a2eeef"
11+
},
12+
{
13+
"name": "question",
14+
"description": "Further information is requested",
15+
"color": "d876e3"
16+
},
17+
{
18+
"name": "documentation",
19+
"description": "Improvements or additions to documentation",
20+
"color": "0075ca"
21+
},
22+
{
23+
"name": "dependencies",
24+
"description": "Pull requests that update a dependency file",
25+
"color": "0366d6"
26+
},
27+
{
28+
"name": "python",
29+
"description": "Python related changes",
30+
"color": "2b67c6"
31+
},
32+
{
33+
"name": "github-actions",
34+
"description": "GitHub Actions workflow changes",
35+
"color": "000000"
36+
},
37+
{
38+
"name": "good first issue",
39+
"description": "Good for newcomers",
40+
"color": "7057ff"
41+
},
42+
{
43+
"name": "help wanted",
44+
"description": "Extra attention is needed",
45+
"color": "008672"
46+
},
47+
{
48+
"name": "wontfix",
49+
"description": "This will not be worked on",
50+
"color": "ffffff"
51+
},
52+
{
53+
"name": "duplicate",
54+
"description": "This issue or pull request already exists",
55+
"color": "cfd3d7"
56+
},
57+
{
58+
"name": "security",
59+
"description": "Security related issues",
60+
"color": "ee0701"
61+
},
62+
{
63+
"name": "performance",
64+
"description": "Performance improvements",
65+
"color": "fbca04"
66+
},
67+
{
68+
"name": "breaking change",
69+
"description": "Changes that break existing functionality",
70+
"color": "b60205"
71+
},
72+
{
73+
"name": "needs testing",
74+
"description": "Needs additional testing",
75+
"color": "ededed"
76+
},
77+
{
78+
"name": "needs review",
79+
"description": "Awaiting code review",
80+
"color": "fbca04"
81+
},
82+
{
83+
"name": "work in progress",
84+
"description": "Currently being worked on",
85+
"color": "fef2c0"
86+
},
87+
{
88+
"name": "blocked",
89+
"description": "Blocked by another issue or external dependency",
90+
"color": "b60205"
91+
},
92+
{
93+
"name": "priority: critical",
94+
"description": "Critical priority - needs immediate attention",
95+
"color": "b60205"
96+
},
97+
{
98+
"name": "priority: high",
99+
"description": "High priority",
100+
"color": "d93f0b"
101+
},
102+
{
103+
"name": "priority: medium",
104+
"description": "Medium priority",
105+
"color": "fbca04"
106+
},
107+
{
108+
"name": "priority: low",
109+
"description": "Low priority",
110+
"color": "0e8a16"
111+
}
112+
]

.github/workflows/lint.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Code Quality
2+
3+
on:
4+
push:
5+
branches: [ master, dev ]
6+
pull_request:
7+
branches: [ master, dev ]
8+
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
13+
jobs:
14+
lint:
15+
name: Lint and Format Check
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v5
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v6
24+
with:
25+
python-version: '3.11'
26+
cache: 'pip'
27+
28+
- name: Install linting tools
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install ruff black isort mypy
32+
33+
- name: Run Ruff
34+
run: |
35+
ruff check . --output-format=github
36+
continue-on-error: true
37+
38+
- name: Run Black
39+
run: |
40+
black --check --diff .
41+
continue-on-error: true
42+
43+
- name: Run isort
44+
run: |
45+
isort --check-only --diff .
46+
continue-on-error: true
47+
48+
- name: Run mypy
49+
run: |
50+
mypy --install-types --non-interactive mcp_server/ || true
51+
continue-on-error: true
52+
53+
complexity:
54+
name: Code Complexity Check
55+
runs-on: ubuntu-latest
56+
57+
steps:
58+
- name: Checkout repository
59+
uses: actions/checkout@v5
60+
61+
- name: Set up Python
62+
uses: actions/setup-python@v6
63+
with:
64+
python-version: '3.11'
65+
66+
- name: Install radon
67+
run: |
68+
pip install radon
69+
70+
- name: Check cyclomatic complexity
71+
run: |
72+
radon cc . -a -nb
73+
continue-on-error: true
74+
75+
- name: Check maintainability index
76+
run: |
77+
radon mi . -nb
78+
continue-on-error: true
79+
80+
spellcheck:
81+
name: Spell Check
82+
runs-on: ubuntu-latest
83+
84+
steps:
85+
- name: Checkout repository
86+
uses: actions/checkout@v5
87+
88+
- name: Check spelling
89+
uses: crate-ci/typos@master
90+
with:
91+
config: ./.typos.toml
92+
continue-on-error: true

.github/workflows/release.yml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
permissions:
9+
contents: write
10+
discussions: write
11+
12+
jobs:
13+
create-release:
14+
name: Create Release
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v5
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v6
25+
with:
26+
python-version: '3.11'
27+
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install build twine
32+
33+
- name: Extract version from tag
34+
id: version
35+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
36+
37+
- name: Generate changelog
38+
id: changelog
39+
run: |
40+
# Get the previous tag
41+
PREV_TAG=$(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1) 2>/dev/null || echo "")
42+
43+
if [ -z "$PREV_TAG" ]; then
44+
# First release - get all commits
45+
CHANGELOG=$(git log --pretty=format:"- %s (%h)" --reverse)
46+
else
47+
# Get commits since previous tag
48+
CHANGELOG=$(git log ${PREV_TAG}..HEAD --pretty=format:"- %s (%h)" --reverse)
49+
fi
50+
51+
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
52+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
53+
echo "EOF" >> $GITHUB_OUTPUT
54+
55+
- name: Build package
56+
run: |
57+
python -m build
58+
59+
- name: Create GitHub Release
60+
uses: softprops/action-gh-release@v2
61+
with:
62+
name: Release ${{ steps.version.outputs.VERSION }}
63+
body: |
64+
## What's Changed
65+
66+
${{ steps.changelog.outputs.CHANGELOG }}
67+
68+
## Installation
69+
70+
```bash
71+
git clone https://github.com/RobThePCGuy/utility-patent-reviewer.git
72+
cd utility-patent-reviewer
73+
git checkout v${{ steps.version.outputs.VERSION }}
74+
python install.py
75+
```
76+
77+
## Upgrade
78+
79+
```bash
80+
cd utility-patent-reviewer
81+
git pull
82+
git checkout v${{ steps.version.outputs.VERSION }}
83+
pip install --upgrade -r requirements.txt
84+
```
85+
86+
---
87+
88+
**Full Changelog**: https://github.com/RobThePCGuy/utility-patent-reviewer/compare/${{ github.event.before }}...${{ github.sha }}
89+
draft: false
90+
prerelease: false
91+
files: |
92+
dist/*
93+
generate_release_notes: true
94+
discussion_category_name: Announcements
95+
96+
- name: Publish to PyPI
97+
if: startsWith(github.ref, 'refs/tags/v')
98+
env:
99+
TWINE_USERNAME: __token__
100+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
101+
run: |
102+
twine upload dist/* --skip-existing
103+
continue-on-error: true
104+
105+
announce-release:
106+
name: Announce Release
107+
needs: create-release
108+
runs-on: ubuntu-latest
109+
110+
steps:
111+
- name: Checkout repository
112+
uses: actions/checkout@v5
113+
114+
- name: Create announcement discussion
115+
uses: abirismyname/create-discussion@v1
116+
env:
117+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
118+
with:
119+
title: "Release ${{ github.ref_name }} is now available!"
120+
body: |
121+
A new version of Utility Patent Reviewer has been released!
122+
123+
Check out the [release notes](${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}) for details.
124+
repository-id: ${{ github.repository }}
125+
category-id: Announcements
126+
continue-on-error: true

0 commit comments

Comments
 (0)