@@ -110,43 +110,50 @@ jobs:
110110 if : ${{ !contains(github.event.pull_request.labels.*.name, 'external') || contains(github.event.pull_request.labels.*.name, 'CI-trusted-author') }}
111111 working-directory : ncs/nrf
112112 run : |
113- mkdir doc/_build/html-doxygen
113+ ROOT="$PWD"
114114
115- # Zephyr APIs (Doxygen)
116- mv doc/_build/html/zephyr/doxygen/html doc/_build/html-doxygen/ zephyr-apis
115+ # Doxygen APIs combined with Sphinx
116+ declare -a SPHINX_DOXYGEN=(" zephyr")
117117
118- cp doc/_zoomin/zephyr.apis.custom.properties doc/_build/html-doxygen/zephyr-apis/custom.properties
119- sed -i 's/__VERSION__/'"${VERSION}"'/g' doc/_build/html-doxygen/zephyr-apis/custom.properties
118+ mkdir doc/_build/html-doxygen
120119
121- cp doc/_zoomin/zephyr.apis.tags.yml doc/_build/html-doxygen/zephyr-apis/tags.yml
122- sed -i 's/__VERSION__/'"${VERSION}"'/g' doc/_build/html-doxygen/zephyr-apis/tags.yml
120+ for docset in "${SPHINX_DOXYGEN[@]}"; do
121+ OUTDIR=doc/_build/html-doxygen/$docset-apis
122+ mv doc/_build/html/$docset/doxygen/html "$OUTDIR"
123123
124- # NCS (Sphinx)
125- cp doc/_zoomin/ncs. custom.properties doc/_build/html/ custom.properties
126- sed -i 's/__VERSION__/'"${ VERSION} "'/g' doc/_build/html/ custom.properties
124+ # Populate custom.properties, tags.yml
125+ cp doc/_zoomin/$docset.apis. custom.properties "$OUTDIR/ custom.properties"
126+ sed -i 's/__VERSION__/'"$VERSION"'/g' "$OUTDIR/ custom.properties"
127127
128- cp doc/_zoomin/ncs. tags.yml doc/_build/html/ tags.yml
129- sed -i 's/__VERSION__/'"${ VERSION} "'/g' doc/_build/html/ tags.yml
128+ cp doc/_zoomin/$docset.apis. tags.yml "$OUTDIR/ tags.yml"
129+ sed -i 's/__VERSION__/'"$VERSION"'/g' "$OUTDIR/ tags.yml"
130130
131- # Patch links from Zephyr ( Sphinx) to Zephyr APIs (Doxygen)
132- find doc/_build/html/zephyr -type f -name "*.html" -exec \
133- sed -ri "/href=\"(.*)\/doxygen\/html\/(.*)\"/{s//href=\"\1\/..\/..\/..\/zephyr -apis-$VERSION\/page\/\2\"/; :a s/__/_/;ta; }" {} \;
131+ # Patch links from Sphinx to Doxygen APIs
132+ find doc/_build/html/$docset -type f -name "*.html" -exec \
133+ sed -ri "/href=\"(.*)\/doxygen\/html\/(.*)\"/{s//href=\"\1\/..\/..\/..\/$docset -apis-$VERSION\/page\/\2\"/; :a s/__/_/;ta; }" {} \;
134134
135- # Prepare archives
136- cd doc/_build/
135+ pushd "$OUTDIR"
136+ ARCHIVE="$docset-apis-$VERSION.zip"
137+ zip -rq "$ARCHIVE" .
138+ mv "$ARCHIVE" "$ROOT"
139+ popd
140+ done
137141
138- cd html-doxygen/zephyr-apis
139- ARCHIVE="zephyr-apis-${VERSION}.zip"
140- zip -rq "${ARCHIVE}" .
141- mv "${ARCHIVE}" ../../../../
142- cd ../../
142+ # NCS
143+ OUTDIR=doc/_build/html
143144
144- ARCHIVE="ncs-${VERSION}.zip"
145- cd html
146- zip -rq "${ARCHIVE}" .
147- mv "${ARCHIVE}" ../../../
148- cd ..
145+ # Populate custom.properties, tags.yml
146+ cp doc/_zoomin/ncs.custom.properties "$OUTDIR/custom.properties"
147+ sed -i 's/__VERSION__/'"$VERSION"'/g' "$OUTDIR/custom.properties"
148+
149+ cp doc/_zoomin/ncs.tags.yml "$OUTDIR/tags.yml"
150+ sed -i 's/__VERSION__/'"$VERSION"'/g' "$OUTDIR/tags.yml"
149151
152+ ARCHIVE="ncs-$VERSION.zip"
153+ pushd "$OUTDIR"
154+ zip -rq "$ARCHIVE" .
155+ mv "$ARCHIVE" "$ROOT"
156+ popd
150157 - name : Store
151158 if : ${{ !contains(github.event.pull_request.labels.*.name, 'external') || contains(github.event.pull_request.labels.*.name, 'CI-trusted-author') }}
152159 uses : actions/upload-artifact@v4
0 commit comments