-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (113 loc) · 4.45 KB
/
docs.yml
File metadata and controls
123 lines (113 loc) · 4.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Documentation
on:
push:
branches: [main]
paths:
- 'Sources/**'
- 'Package.swift'
- 'Package.resolved'
workflow_dispatch: # allow manual trigger
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
build-docs:
name: Build DocC
runs-on: macos-15 # Xcode 16 / Swift 6
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache SPM
uses: actions/cache@v4
with:
path: .build
key: macos-spm-docs-v2-${{ hashFiles('Package.resolved') }}
restore-keys: |
macos-spm-docs-v2-
- name: Setup GitHub Pages
uses: actions/configure-pages@v5
- name: Build documentation for all modules
run: |
mkdir -p docs
for TARGET in CosmoSQLCore CosmoMSSQL CosmoPostgres CosmoMySQL CosmoSQLite; do
echo "▶ Building docs for $TARGET"
swift package \
--allow-writing-to-directory "docs/$TARGET" \
generate-documentation \
--target "$TARGET" \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path "CosmoSQLClient-Swift/$TARGET" \
--output-path "docs/$TARGET"
done
# Create a landing index.html that links to each module's docs
- name: Generate landing page
run: |
cat > docs/index.html << 'HTML'
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CosmoSQLClient-Swift Documentation</title>
<style>
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
max-width: 720px; margin: 60px auto; padding: 0 24px; color: #1d1d1f; }
h1 { font-size: 2rem; margin-bottom: 0.25em; }
p { color: #6e6e73; }
ul { list-style: none; padding: 0; display: grid; gap: 12px; margin-top: 32px; }
li a { display: block; padding: 20px 24px; border: 1px solid #d2d2d7;
border-radius: 12px; text-decoration: none; color: inherit;
transition: box-shadow .15s; }
li a:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }
li a strong { display: block; font-size: 1.1rem; color: #0071e3; }
li a span { font-size: .9rem; color: #6e6e73; margin-top: 4px; display: block; }
</style>
</head>
<body>
<h1>CosmoSQLClient-Swift</h1>
<p>A unified Swift NIO-based SQL driver for SQL Server, PostgreSQL, MySQL, and SQLite.</p>
<ul>
<li><a href="CosmoSQLCore/documentation/cosmosqlcore/">
<strong>CosmoSQLCore</strong>
<span>Shared protocol, types & utilities — SQLDatabase, SQLValue, SQLRow, SQLDataTable</span>
</a></li>
<li><a href="CosmoMSSQL/documentation/cosmomssql/">
<strong>CosmoMSSQL</strong>
<span>Microsoft SQL Server driver — TDS 7.4 wire protocol, NTLM auth, stored procedures</span>
</a></li>
<li><a href="CosmoPostgres/documentation/cosmopostgres/">
<strong>CosmoPostgres</strong>
<span>PostgreSQL driver — wire protocol v3, SCRAM-SHA-256 auth</span>
</a></li>
<li><a href="CosmoMySQL/documentation/cosmomysql/">
<strong>CosmoMySQL</strong>
<span>MySQL / MariaDB driver — wire protocol v10, caching_sha2_password auth</span>
</a></li>
<li><a href="CosmoSQLite/documentation/cosmosqlite/">
<strong>CosmoSQLite</strong>
<span>Embedded SQLite — in-memory & file databases, native binary backup</span>
</a></li>
</ul>
</body>
</html>
HTML
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs
deploy-docs:
name: Deploy to GitHub Pages
needs: build-docs
runs-on: ubuntu-24.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v4