File tree Expand file tree Collapse file tree 2 files changed +54
-1
lines changed Expand file tree Collapse file tree 2 files changed +54
-1
lines changed Original file line number Diff line number Diff line change 24
24
env :
25
25
DOCC : docc
26
26
run : |
27
- ./scripts/build-docc.sh
27
+ ./scripts/build-docc-gh .sh
28
28
- name : Commit
29
29
env :
30
30
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ # GitHub action version of build-docc which does not use the plugin. While GH actions
3
+ # are not available in the macOS-latest image GitHub provide this script will be necessary
4
+ TEMP_DIR=" $( pwd) /temp"
5
+
6
+ cleanup ()
7
+ {
8
+ if [ -n " $TEMP_DIR " ]; then
9
+ rm -rf $TEMP_DIR
10
+ fi
11
+ }
12
+ trap cleanup exit $?
13
+
14
+ SG_FOLDER=.build/symbol-graphs
15
+ MQTTNIO_SG_FOLDER=.build/mqtt-nio-symbol-graphs
16
+ OUTPUT_PATH=docs/mqtt-nio/
17
+
18
+ BUILD_SYMBOLS=1
19
+
20
+ while getopts ' s' option
21
+ do
22
+ case $option in
23
+ s) BUILD_SYMBOLS=0;;
24
+ esac
25
+ done
26
+
27
+ if [ -z " ${DOCC_HTML_DIR:- } " ]; then
28
+ git clone https://github.com/apple/swift-docc-render-artifact $TEMP_DIR /swift-docc-render-artifact
29
+ export DOCC_HTML_DIR=" $TEMP_DIR /swift-docc-render-artifact/dist"
30
+ fi
31
+
32
+ if test " $BUILD_SYMBOLS " == 1; then
33
+ # build symbol graphs
34
+ mkdir -p $SG_FOLDER
35
+ swift build \
36
+ -Xswiftc -emit-symbol-graph \
37
+ -Xswiftc -emit-symbol-graph-dir -Xswiftc $SG_FOLDER
38
+ # Copy MQTTNIO symbol graph into separate folder
39
+ mkdir -p $MQTTNIO_SG_FOLDER
40
+ cp $SG_FOLDER /MQTTNIO* $MQTTNIO_SG_FOLDER
41
+ fi
42
+
43
+ # Build documentation
44
+ mkdir -p $OUTPUT_PATH
45
+ rm -rf $OUTPUT_PATH /*
46
+ docc convert Sources/MQTTNIO/MQTTNIO.docc \
47
+ --transform-for-static-hosting \
48
+ --hosting-base-path /mqtt-nio \
49
+ --fallback-display-name MQTTNIO \
50
+ --fallback-bundle-identifier org.swift-server-community.mqtt-nio \
51
+ --fallback-bundle-version 1 \
52
+ --additional-symbol-graph-dir $MQTTNIO_SG_FOLDER \
53
+ --output-path $OUTPUT_PATH
You can’t perform that action at this time.
0 commit comments