@@ -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})
0 commit comments