-
Notifications
You must be signed in to change notification settings - Fork 1
206 lines (196 loc) · 5.95 KB
/
Copy pathdocs.yml
File metadata and controls
206 lines (196 loc) · 5.95 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
name: Docs
# Builds each binding's API docs, assembles them into one site, and publishes to
# GitHub Pages at https://meshtastic.github.io/TAKPacket-SDK/.
#
# ONE-TIME SETUP: a repo admin must set Settings → Pages → Source = "GitHub Actions"
# for the deploy step to publish.
on:
workflow_dispatch:
release:
types: [published]
push:
branches: [master]
paths:
- "kotlin/**/*.kt"
- "kotlin/module.md"
- "kotlin/build.gradle.kts"
- "swift/Sources/**"
- "Package.swift"
- "swift/Package.swift"
- "python/src/**/*.py"
- "python/pyproject.toml"
- "python/README.md"
- "typescript/src/**/*.ts"
- "typescript/typedoc.json"
- "typescript/package.json"
- "csharp/src/**/*.cs"
- "csharp/docfx.json"
- "csharp/index.md"
- "csharp/toc.yml"
- "csharp/api/index.md"
- "csharp/src/Meshtastic.TAK/Meshtastic.TAK.csproj"
- "docs/index.html"
- ".github/workflows/docs.yml"
# Least-privilege defaults; the deploy job needs pages + id-token to publish.
permissions:
contents: read
# Never cancel an in-flight Pages deployment.
concurrency:
group: pages
cancel-in-progress: false
jobs:
kotlin:
name: Kotlin (Dokka)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
submodules: true
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21
- name: Build Dokka HTML
working-directory: kotlin
run: ./gradlew dokkaGeneratePublicationHtml --quiet
- uses: actions/upload-artifact@v7
with:
name: docs-kotlin
path: kotlin/build/dokka/html
swift:
name: Swift (DocC)
runs-on: macos-latest
steps:
- uses: actions/checkout@v7
with:
submodules: true
- name: Build DocC static site
# Run from the repo root (root Package.swift). hosting-base-path matches the
# /swift/ subpath of the project Pages site.
run: |
swift package --allow-writing-to-directory docc-out \
generate-documentation \
--target MeshtasticTAK \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path TAKPacket-SDK/swift \
--output-path docc-out
- name: Package DocC output
# DocC emits a data file per symbol, including synthesized operators like
# "!=(_:_:).json". actions/upload-artifact rejects ":" in file names (an
# NTFS-compat rule), so tar the tree to carry those names inside the
# archive. The deploy job untars it; Pages' own upload-pages-artifact also
# tars, so serving the ":" files works fine.
run: tar -czf docc-swift.tgz -C docc-out .
- uses: actions/upload-artifact@v7
with:
name: docs-swift
path: docc-swift.tgz
typescript:
name: TypeScript (TypeDoc)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
submodules: true
- uses: actions/setup-node@v6
with:
node-version: 24
- name: Install deps
working-directory: typescript
run: rm -f package-lock.json && npm install
- name: Build TypeDoc
working-directory: typescript
run: npm run docs
- uses: actions/upload-artifact@v7
with:
name: docs-typescript
path: typescript/docs
python:
name: Python (pdoc)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
submodules: true
- uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Install package + docs deps
run: pip install -e "./python[dev]"
- name: Build pdoc
run: pdoc meshtastic_tak -o site-python -d google
- uses: actions/upload-artifact@v7
with:
name: docs-python
path: site-python
csharp:
name: C# (DocFX)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
submodules: true
- uses: actions/setup-dotnet@v5
with:
dotnet-version: "9.0.x"
- name: Install DocFX
run: |
dotnet tool install -g docfx
echo "$HOME/.dotnet/tools" >> "$GITHUB_PATH"
- name: Build DocFX site
working-directory: csharp
run: docfx docfx.json
- uses: actions/upload-artifact@v7
with:
name: docs-csharp
path: csharp/_site
deploy:
name: Assemble & deploy to Pages
needs: [kotlin, swift, typescript, python, csharp]
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v7
- name: Lay out the landing page
run: |
mkdir -p site
cp docs/index.html site/index.html
# Disable Jekyll so files/dirs starting with "_" (Dokka, DocFX, DocC
# assets) are served verbatim.
touch site/.nojekyll
- uses: actions/download-artifact@v8
with:
name: docs-kotlin
path: site/kotlin
- uses: actions/download-artifact@v8
with:
name: docs-swift
path: swift-artifact
- name: Unpack Swift DocC
run: |
mkdir -p site/swift
tar -xzf swift-artifact/docc-swift.tgz -C site/swift
- uses: actions/download-artifact@v8
with:
name: docs-typescript
path: site/typescript
- uses: actions/download-artifact@v8
with:
name: docs-python
path: site/python
- uses: actions/download-artifact@v8
with:
name: docs-csharp
path: site/csharp
- uses: actions/configure-pages@v6
- uses: actions/upload-pages-artifact@v5
with:
path: site
- id: deployment
uses: actions/deploy-pages@v5