Skip to content

Commit f4e1da4

Browse files
committed
ci: generate docs for site and use in build
Signed-off-by: Ruby Iris Juric <[email protected]>
1 parent bef2edf commit f4e1da4

File tree

1 file changed

+106
-2
lines changed

1 file changed

+106
-2
lines changed

.github/workflows/build.yml

Lines changed: 106 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,121 @@
11
name: Build static site
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches: [main]
67

78
jobs:
9+
# TODO: build these docs in pebble-dev/pebble-firmware, and publish in releases
10+
gendocs-c:
11+
runs-on: ubuntu-24.04
12+
container:
13+
image: ghcr.io/pebble-dev/pebbleos-docker:main
14+
15+
steps:
16+
- name: Checkout pebble-firmware
17+
uses: actions/checkout@v4
18+
with:
19+
repository: pebble-dev/pebble-firmware
20+
ref: main
21+
submodules: true
22+
23+
- name: Install Python dependencies
24+
run: |
25+
pip install -U pip
26+
pip install -r requirements.txt
27+
28+
- name: Build aplite SDK
29+
run: |
30+
./waf configure --board bb2 --nojs
31+
./waf build --onlysdk
32+
33+
- name: Build basalt SDK
34+
run: |
35+
./waf configure --board snowy_bb2
36+
./waf build --onlysdk
37+
38+
- name: Generate SDK documentation
39+
run: |
40+
./waf docs_sdk
41+
42+
- name: Publish docs artifact
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: docs-c
46+
path: |
47+
build/sdk/aplite/doxygen_sdk
48+
build/sdk/basalt/doxygen_sdk
49+
50+
# TODO: maybe build in pebble-dev/pebble-android-sdk, and publish releases?
51+
gendocs-android:
52+
runs-on: ubuntu-24.04
53+
54+
steps:
55+
- name: Checkout pebble-android-sdk
56+
uses: actions/checkout@v4
57+
with:
58+
# TODO: use pebble-dev when https://github.com/pebble-dev/pebble-android-sdk/pull/1 merged
59+
repository: Sorixelle/pebble-android-sdk
60+
ref: javadocs
61+
62+
- name: Generate documentation
63+
working-directory: PebbleKit
64+
run: |
65+
./gradlew releaseJavadoc
66+
67+
- name: Publish docs artifact
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: docs-android
71+
path: PebbleKit/PebbleKit/build/docs/javadoc
72+
73+
# TODO: maybe fork into pebble-dev, build there, and publish releases?
74+
gendocs-ios:
75+
runs-on: ubuntu-24.04
76+
77+
steps:
78+
- name: Checkout pebble-ios-sdk
79+
uses: actions/checkout@v4
80+
with:
81+
repository: pebble/pebble-ios-sdk
82+
83+
- name: Publish docs artifact
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: docs-ios
87+
path: PebbleKit-iOS.docset/Contents/Resources/Documents
88+
889
build:
990
runs-on: ubuntu-24.04
91+
needs:
92+
- gendocs-c
93+
- gendocs-android
94+
- gendocs-ios
1095

1196
steps:
1297
- name: Checkout
1398
uses: actions/checkout@v4
1499

100+
- name: Download docs artifacts
101+
uses: actions/download-artifact@v4
102+
with:
103+
pattern: docs-*
104+
path: /tmp/docs
105+
106+
- name: Create docs archives
107+
working-directory: /tmp/docs
108+
run: |
109+
cd docs-c
110+
zip -r ../PebbleSDK-4.3_docs.zip {aplite,basalt}/doxygen_sdk
111+
cd ..
112+
113+
mv docs-android javadoc
114+
zip -r pebblekit_android_4.0.1.zip javadoc
115+
116+
cd docs-ios
117+
zip -r ../pebblekit_ios_4.0.0.zip *
118+
15119
- name: Setup Ruby
16120
uses: ruby/setup-ruby@v1
17121
with:
@@ -20,10 +124,10 @@ jobs:
20124
- name: Build site
21125
run: bundle exec jekyll build
22126
env:
23-
URL: http://developer.rebble.io
127+
URL: https://developer.rebble.io
24128
HTTPS_URL: https://developer.rebble.io
25129
JEKYLL_ENV: production
26-
SKIP_DOCS: true # TODO: setup docs generation
130+
DOCS_URL: /tmp/docs/
27131

28132
- name: Upload artifact
29133
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)