Skip to content

Commit 6d5a2e2

Browse files
committed
Initial Commit
0 parents  commit 6d5a2e2

File tree

85 files changed

+34317
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+34317
-0
lines changed

.github/workflows/docs.yml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
paths:
7+
- 'docs/**'
8+
- 'src/**'
9+
- '.github/workflows/docs.yml'
10+
- 'pyproject.toml'
11+
pull_request:
12+
branches: [ main ]
13+
paths:
14+
- 'docs/**'
15+
- 'src/**'
16+
- '.github/workflows/docs.yml'
17+
- 'pyproject.toml'
18+
19+
# Add permissions for GitHub Pages deployment
20+
permissions:
21+
contents: read
22+
pages: write
23+
id-token: write
24+
25+
jobs:
26+
build-docs:
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v4
32+
33+
- name: Set up Python
34+
uses: actions/setup-python@v4
35+
with:
36+
python-version: '3.12'
37+
38+
- name: Install dependencies
39+
run: |
40+
python -m pip install --upgrade pip
41+
pip install -e .[docs]
42+
43+
- name: Check documentation coverage
44+
run: |
45+
cd docs
46+
make coverage
47+
48+
- name: Check for broken links
49+
run: |
50+
cd docs
51+
make linkcheck
52+
continue-on-error: true # Don't fail build on broken external links
53+
54+
- name: Build documentation
55+
run: |
56+
cd docs
57+
make html
58+
59+
- name: Check build warnings
60+
run: |
61+
cd docs
62+
if [ -s _build/html/.doctrees/warnings.txt ]; then
63+
echo "Documentation build has warnings:"
64+
cat _build/html/.doctrees/warnings.txt
65+
exit 1
66+
fi
67+
continue-on-error: true
68+
69+
- name: Upload documentation artifacts
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: documentation
73+
path: docs/_build/html/
74+
75+
deploy-docs:
76+
runs-on: ubuntu-latest
77+
needs: build-docs
78+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
79+
80+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
81+
permissions:
82+
pages: write # to deploy to Pages
83+
id-token: write # to verify the deployment originates from an appropriate source
84+
85+
# Configure environment for GitHub Pages deployment
86+
environment:
87+
name: github-pages
88+
url: ${{ steps.deployment.outputs.page_url }}
89+
90+
steps:
91+
- name: Download documentation artifacts
92+
uses: actions/download-artifact@v4
93+
with:
94+
name: documentation
95+
path: docs/_build/html/
96+
97+
- name: Setup Pages
98+
uses: actions/configure-pages@v4
99+
100+
- name: Upload to GitHub Pages
101+
uses: actions/upload-pages-artifact@v3
102+
with:
103+
path: docs/_build/html/
104+
105+
- name: Deploy to GitHub Pages
106+
id: deployment
107+
uses: actions/deploy-pages@v4
108+
109+
readthedocs-webhook:
110+
runs-on: ubuntu-latest
111+
needs: build-docs
112+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
113+
114+
steps:
115+
- name: Trigger ReadTheDocs build
116+
run: |
117+
curl -X POST \
118+
-H "Authorization: Token ${{ secrets.READTHEDOCS_TOKEN }}" \
119+
https://readthedocs.org/api/v3/projects/project-x-py/builds/
120+
continue-on-error: true # Don't fail if webhook isn't configured

.github/workflows/version-sync.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Version Synchronization
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths: ['src/project_x_py/__init__.py']
7+
workflow_dispatch:
8+
inputs:
9+
force_sync:
10+
description: 'Force version synchronization'
11+
required: false
12+
default: 'false'
13+
14+
jobs:
15+
sync-versions:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: '3.12'
26+
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v3
29+
30+
- name: Check version synchronization
31+
id: check-sync
32+
run: |
33+
python scripts/version_sync.py
34+
if git diff --quiet; then
35+
echo "sync_needed=false" >> $GITHUB_OUTPUT
36+
else
37+
echo "sync_needed=true" >> $GITHUB_OUTPUT
38+
fi
39+
40+
- name: Commit version updates
41+
if: steps.check-sync.outputs.sync_needed == 'true'
42+
run: |
43+
git config --local user.email "[email protected]"
44+
git config --local user.name "GitHub Action"
45+
git add -A
46+
git commit -m "🔄 Auto-sync version numbers [skip ci]"
47+
git push
48+
49+
- name: Create version tag
50+
if: steps.check-sync.outputs.sync_needed == 'true'
51+
run: |
52+
VERSION=$(python -c "from src.project_x_py import __version__; print(__version__)")
53+
git tag "v$VERSION" || echo "Tag v$VERSION already exists"
54+
git push origin "v$VERSION" || echo "Tag v$VERSION already pushed"

0 commit comments

Comments
 (0)