Skip to content

docs(readme): rewrite for v2.0 Tag API and trim to 160 lines #71

docs(readme): rewrite for v2.0 Tag API and trim to 160 lines

docs(readme): rewrite for v2.0 Tag API and trim to 160 lines #71

Workflow file for this run

name: Generate API Docs
on:
push:
branches: [main]
paths:
- 'libs/**/*.m'
workflow_dispatch:
permissions:
contents: write
jobs:
generate:
name: Generate API Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout main repo
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Generate API docs
run: python3 scripts/generate_api_docs.py
- name: Commit updated wiki
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add wiki/
if git diff --cached --quiet; then
echo "No documentation changes"
else
git commit -m "docs: auto-update API reference from source code"
git push
echo "Wiki API docs updated in main repo"
fi
- name: Sync to wiki repo
if: success()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Only sync if the commit step actually pushed changes
if git log -1 --format='%s' | grep -q "auto-update API reference"; then
git clone "https://x-access-token:${GITHUB_TOKEN}@github.com/HanSur94/FastSense.wiki.git" wiki-remote
rm -f wiki-remote/*.md
cp wiki/*.md wiki-remote/
cd wiki-remote
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
if git diff --cached --quiet; then
echo "Wiki repo already up to date"
else
git commit -m "docs: sync wiki from main repo"
git push
echo "Wiki repo synced"
fi
else
echo "No wiki changes were committed, skipping sync"
fi