Skip to content

Commit 7ac4f1f

Browse files
committed
Merge branch 'main' of github.com:BinarCode/aidocs-cli
2 parents b4977a7 + e546f97 commit 7ac4f1f

File tree

9 files changed

+555
-232
lines changed

9 files changed

+555
-232
lines changed

.github/workflows/publish.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 97 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -10,104 +10,133 @@ jobs:
1010
runs-on: ubuntu-latest
1111
permissions:
1212
contents: write
13+
id-token: write # Required for trusted publishing to PyPI
1314

1415
steps:
1516
- uses: actions/checkout@v4
1617
with:
1718
fetch-depth: 0
1819
token: ${{ secrets.GITHUB_TOKEN }}
1920

20-
- name: Get current version
21-
id: current
21+
- name: Get version from pyproject.toml
22+
id: version
2223
run: |
2324
VERSION=$(grep -m1 'version = ' pyproject.toml | cut -d'"' -f2)
2425
echo "version=$VERSION" >> $GITHUB_OUTPUT
25-
echo "Current version: $VERSION"
26-
27-
- name: Determine version bump
28-
id: bump
29-
run: |
30-
COMMIT_MSG=$(git log -1 --pretty=%B)
31-
echo "Commit message: $COMMIT_MSG"
32-
33-
# Check if commit message indicates minor bump (feat/feature)
34-
if echo "$COMMIT_MSG" | grep -qiE "^feat(\(.*\))?:|^feature(\(.*\))?:"; then
35-
echo "bump=minor" >> $GITHUB_OUTPUT
36-
else
37-
echo "bump=patch" >> $GITHUB_OUTPUT
38-
fi
39-
40-
- name: Calculate new version
41-
id: new
42-
run: |
43-
CURRENT="${{ steps.current.outputs.version }}"
44-
BUMP="${{ steps.bump.outputs.bump }}"
45-
46-
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT"
47-
48-
if [ "$BUMP" = "minor" ]; then
49-
MINOR=$((MINOR + 1))
50-
PATCH=0
51-
else
52-
PATCH=$((PATCH + 1))
53-
fi
54-
55-
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
56-
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
57-
echo "New version: $NEW_VERSION (bump: $BUMP)"
26+
echo "Version from pyproject.toml: $VERSION"
5827
5928
- name: Check if version already released
6029
id: check
6130
run: |
62-
NEW_VERSION="${{ steps.new.outputs.version }}"
63-
if git tag | grep -q "^v$NEW_VERSION$"; then
31+
VERSION="${{ steps.version.outputs.version }}"
32+
if git tag | grep -q "^v$VERSION$"; then
6433
echo "skip=true" >> $GITHUB_OUTPUT
65-
echo "Version v$NEW_VERSION already exists, skipping"
34+
echo "Version v$VERSION already exists, skipping"
6635
else
6736
echo "skip=false" >> $GITHUB_OUTPUT
37+
echo "Version v$VERSION not released yet"
6838
fi
6939
70-
- name: Update version in files
40+
- name: Create tag and release
7141
if: steps.check.outputs.skip == 'false'
42+
env:
43+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7244
run: |
73-
NEW_VERSION="${{ steps.new.outputs.version }}"
45+
VERSION="${{ steps.version.outputs.version }}"
46+
COMMIT_MSG=$(git log -1 --pretty=%B | head -1)
7447
75-
# Update pyproject.toml
76-
sed -i "s/^version = \".*\"/version = \"$NEW_VERSION\"/" pyproject.toml
48+
git config user.name "GitHub Actions"
49+
git config user.email "actions@github.com"
50+
git tag -a "v$VERSION" -m "Release v$VERSION"
51+
git push origin "v$VERSION"
7752
78-
# Update __init__.py
79-
sed -i "s/__version__ = \".*\"/__version__ = \"$NEW_VERSION\"/" src/aidocs_cli/__init__.py
53+
cat <<EOF | gh release create "v$VERSION" --title "v$VERSION" --notes-file -
54+
## Changes
8055
81-
echo "Updated version to $NEW_VERSION"
56+
$COMMIT_MSG
8257
83-
- name: Commit version bump
58+
---
59+
*Auto-generated release*
60+
EOF
61+
62+
# Publish to PyPI
63+
- name: Install uv
8464
if: steps.check.outputs.skip == 'false'
85-
run: |
86-
NEW_VERSION="${{ steps.new.outputs.version }}"
87-
git config user.name "GitHub Actions"
88-
git config user.email "actions@github.com"
89-
git add pyproject.toml src/aidocs_cli/__init__.py
90-
git commit -m "chore: bump version to $NEW_VERSION [skip ci]"
91-
git push
65+
uses: astral-sh/setup-uv@v4
66+
with:
67+
version: "latest"
9268

93-
- name: Create tag and release
69+
- name: Set up Python
9470
if: steps.check.outputs.skip == 'false'
95-
env:
96-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97-
run: |
98-
NEW_VERSION="${{ steps.new.outputs.version }}"
99-
COMMIT_MSG=$(git log -2 --pretty=%B | tail -n +3 | head -1)
71+
run: uv python install 3.11
10072

101-
# Create tag
102-
git tag -a "v$NEW_VERSION" -m "Release v$NEW_VERSION"
103-
git push origin "v$NEW_VERSION"
73+
- name: Build package
74+
if: steps.check.outputs.skip == 'false'
75+
run: uv build
10476

105-
# Create release
106-
NOTES="## Changes
77+
- name: Publish to PyPI
78+
if: steps.check.outputs.skip == 'false'
79+
uses: pypa/gh-action-pypi-publish@release/v1
80+
with:
81+
skip-existing: true
10782

108-
${COMMIT_MSG}
83+
# Update Homebrew formula
84+
- name: Get release info for Homebrew
85+
if: steps.check.outputs.skip == 'false'
86+
id: homebrew
87+
run: |
88+
VERSION="${{ steps.version.outputs.version }}"
89+
URL="https://github.com/${{ github.repository }}/archive/refs/tags/v$VERSION.tar.gz"
90+
SHA256=$(curl -sL "$URL" | shasum -a 256 | cut -d' ' -f1)
10991
110-
---
111-
*Auto-generated release*"
92+
echo "version=$VERSION" >> $GITHUB_OUTPUT
93+
echo "url=$URL" >> $GITHUB_OUTPUT
94+
echo "sha256=$SHA256" >> $GITHUB_OUTPUT
11295
113-
gh release create "v$NEW_VERSION" --title "v$NEW_VERSION" --notes "$NOTES"
96+
echo "Homebrew URL: $URL"
97+
echo "Homebrew SHA256: $SHA256"
98+
99+
- name: Checkout homebrew-aidocs
100+
if: steps.check.outputs.skip == 'false'
101+
uses: actions/checkout@v4
102+
with:
103+
repository: binarcode/homebrew-aidocs
104+
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
105+
path: homebrew-aidocs
106+
107+
- name: Update Homebrew formula
108+
if: steps.check.outputs.skip == 'false'
109+
run: |
110+
cat > homebrew-aidocs/Formula/aidocs.rb << EOF
111+
class Aidocs < Formula
112+
include Language::Python::Virtualenv
113+
114+
desc "AI-powered documentation generator CLI for Claude Code"
115+
homepage "https://github.com/binarcode/aidocs-cli"
116+
url "${{ steps.homebrew.outputs.url }}"
117+
sha256 "${{ steps.homebrew.outputs.sha256 }}"
118+
license "MIT"
119+
120+
depends_on "python@3.11"
121+
122+
def install
123+
venv = virtualenv_create(libexec, "python3.11")
124+
venv.pip_install "aidocs==${{ steps.homebrew.outputs.version }}"
125+
bin.install_symlink libexec/"bin/aidocs"
126+
end
127+
128+
test do
129+
assert_match "aidocs", shell_output("#{bin}/aidocs version")
130+
end
131+
end
132+
EOF
133+
134+
- name: Commit and push Homebrew formula
135+
if: steps.check.outputs.skip == 'false'
136+
run: |
137+
cd homebrew-aidocs
138+
git config user.name "GitHub Actions"
139+
git config user.email "actions@github.com"
140+
git add Formula/aidocs.rb
141+
git diff --staged --quiet || git commit -m "Update aidocs to ${{ steps.homebrew.outputs.version }}"
142+
git push

.github/workflows/update-homebrew.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Contributing to aidocs-cli
2+
3+
Thank you for your interest in contributing to aidocs-cli!
4+
5+
## Development Setup
6+
7+
1. Clone the repository:
8+
```bash
9+
git clone https://github.com/binarcode/aidocs-cli.git
10+
cd aidocs-cli
11+
```
12+
13+
2. Install dependencies with uv:
14+
```bash
15+
uv sync
16+
```
17+
18+
3. Run locally:
19+
```bash
20+
uv run aidocs --help
21+
```
22+
23+
## Making Changes
24+
25+
### Version Bump Required
26+
27+
**Important:** When creating a PR, you must update the version number in two files:
28+
29+
1. `pyproject.toml` - Update the `version` field
30+
2. `src/aidocs_cli/__init__.py` - Update the `__version__` variable
31+
32+
Both files must have the same version number.
33+
34+
### Version Format
35+
36+
We use [Semantic Versioning](https://semver.org/):
37+
38+
- **Patch** (0.15.x → 0.15.y): Bug fixes, minor changes
39+
- **Minor** (0.x.0 → 0.y.0): New features, non-breaking changes
40+
- **Major** (x.0.0 → y.0.0): Breaking changes
41+
42+
### Why?
43+
44+
Our release workflow reads the version from `pyproject.toml` and automatically:
45+
- Creates a GitHub release with that version
46+
- Publishes to PyPI
47+
- Updates the Homebrew formula
48+
49+
If you don't bump the version, no release will be created when your PR is merged.
50+
51+
## Pull Request Process
52+
53+
1. Fork the repository
54+
2. Create a feature branch (`git checkout -b feature/my-feature`)
55+
3. Make your changes
56+
4. **Bump the version** in both files
57+
5. Commit your changes
58+
6. Push to your fork
59+
7. Open a Pull Request
60+
61+
## Code Style
62+
63+
- Follow PEP 8 for Python code
64+
- Use type hints where possible
65+
- Keep functions focused and well-documented
66+
67+
## Questions?
68+
69+
Open an issue if you have questions or need help.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "aidocs"
3-
version = "0.14.2"
3+
version = "0.15.4"
44
description = "AI-powered documentation generator for web applications. Install docs commands into your Claude Code project."
55
readme = "README.md"
66
license = { text = "MIT" }

src/aidocs_cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""AI-powered documentation generator CLI for Claude Code projects."""
22

3-
__version__ = "0.14.2"
3+
__version__ = "0.15.4"
44

55
from .cli import app
66

0 commit comments

Comments
 (0)