Skip to content

Commit d03c49c

Browse files
committed
ci: improve documentation build process and enhance developer guide
1 parent e7d0e11 commit d03c49c

File tree

2 files changed

+50
-13
lines changed

2 files changed

+50
-13
lines changed

.github/workflows/pages.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,30 +37,34 @@ jobs:
3737

3838
- name: Build documentation
3939
run: |
40-
mkdir -p docs/downloads
41-
cp README.md docs/index.md
42-
cp DEVELOPER.md docs/guide/developer.md
40+
# Create all required directories first
41+
mkdir -p docs/{guide,downloads}
4342
44-
# Create downloads page with version info
45-
cat > docs/downloads/index.md << 'EOL'
46-
# Downloads
43+
# Create index from README
44+
cp README.md docs/index.md || echo "# NetworkMonitor" > docs/index.md
4745
48-
## Latest Release
49-
EOL
46+
# Copy or create developer guide
47+
cp DEVELOPER.md docs/guide/developer.md || echo "# Developer Guide" > docs/guide/developer.md
5048
51-
# Get latest release info using GitHub API
49+
# Get version info
5250
if [ -n "${{ github.event.release.tag_name }}" ]; then
53-
# Use the current release info if this is a release event
5451
VERSION="${{ github.event.release.tag_name }}"
5552
DATE=$(date -d "${{ github.event.release.published_at }}" +%Y-%m-%d)
5653
else
57-
# Otherwise fetch latest release info
58-
LATEST_RELEASE=$(curl -s -H "Accept: application/vnd.github.v3+json" \
54+
# Fetch latest release info
55+
LATEST_RELEASE=$(curl -s -H "Accept: application/vnd.github+json" \
56+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
5957
"https://api.github.com/repos/${{ github.repository }}/releases/latest")
6058
VERSION=$(echo "$LATEST_RELEASE" | jq -r .tag_name)
6159
DATE=$(echo "$LATEST_RELEASE" | jq -r .published_at | cut -d'T' -f1)
6260
fi
6361
62+
cat > docs/downloads/index.md << 'EOL'
63+
# Downloads
64+
65+
## Latest Release
66+
EOL
67+
6468
cat >> docs/downloads/index.md << EOL
6569
6670
Version: ${VERSION} (Released: ${DATE})

DEVELOPER.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,4 +564,37 @@ Critical packages:
564564

565565
# Developer Documentation
566566

567-
[Copy content from your existing DEVELOPER.md or create a basic guide]
567+
# Developer Guide
568+
569+
## Setup Development Environment
570+
571+
1. Prerequisites:
572+
- Python 3.9 or later
573+
- Npcap (Windows only)
574+
- Git
575+
576+
2. Clone and Setup:
577+
```bash
578+
git clone https://github.com/umerfarok/netmoniter.git
579+
cd netmoniter
580+
python -m venv venv
581+
source venv/bin/activate # or `venv\Scripts\activate` on Windows
582+
pip install -r requirements.txt
583+
pip install -r requirements-build.txt
584+
```
585+
586+
## Building
587+
588+
```bash
589+
python build.py
590+
```
591+
592+
## Testing
593+
594+
```bash
595+
python -m pytest tests/
596+
```
597+
598+
## Contributing
599+
600+
See CONTRIBUTING.md for guidelines.

0 commit comments

Comments
 (0)