Skip to content

Commit 7199d8d

Browse files
committed
doc: Azure upload to v1.0.1
Azure doc upload to v1.0.1. Signed-off-by: divya pillai <divya.pillai@nordicsemi.no>
1 parent 5945158 commit 7199d8d

5 files changed

Lines changed: 142 additions & 118 deletions

File tree

.github/workflows/doc-build-and-publish-zoomin.yml

Lines changed: 0 additions & 116 deletions
This file was deleted.

.github/workflows/doc-build.yml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: Documentation Build
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
branches:
10+
- main
11+
- 'v*-branch'
12+
paths:
13+
- '.github/workflows/doc-build.yml'
14+
- '.github/workflows/doc-publish.yml'
15+
- '**.rst'
16+
- 'doc/**'
17+
- "include/**"
18+
push:
19+
branches:
20+
- main
21+
- 'v*-branch'
22+
tags:
23+
- v*
24+
25+
env:
26+
DOXYGEN_VERSION: 1.12.0
27+
28+
concurrency:
29+
group: ${{ github.workflow }}-${{ github.ref }}
30+
cancel-in-progress: true
31+
32+
jobs:
33+
build:
34+
runs-on: ubuntu-24.04
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
38+
with:
39+
ref: ${{ github.event.pull_request.head.sha }}
40+
41+
- name: Install system dependencies
42+
run: |
43+
wget --no-verbose "https://github.com/doxygen/doxygen/releases/download/Release_${DOXYGEN_VERSION//./_}/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz"
44+
sudo tar xf doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz -C /opt
45+
echo "/opt/doxygen-${DOXYGEN_VERSION}/bin" >> $GITHUB_PATH
46+
47+
- name: Set up Python
48+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
49+
with:
50+
python-version: 3.12
51+
cache: pip
52+
cache-dependency-path: doc/requirements.txt
53+
pip-install: |
54+
-r doc/requirements.txt
55+
56+
- name: Build
57+
working-directory: doc
58+
run: |
59+
doxygen
60+
sphinx-build -M html . build
61+
62+
- name: Check version
63+
run: |
64+
VERSION_REGEX="^v([0-9a-zA-Z\.\-]+)$"
65+
if [[ ${GITHUB_REF#refs/tags/} =~ $VERSION_REGEX ]]; then
66+
VERSION=${BASH_REMATCH[1]}
67+
elif [[ ${GITHUB_REF#refs/heads/} == "main" ]]; then
68+
VERSION="latest"
69+
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
70+
VERSION="pr-${{ github.event.number }}"
71+
fi
72+
echo "VERSION=${VERSION}"
73+
echo "VERSION=${VERSION}" >> "$GITHUB_ENV"
74+
75+
- name: Prepare Azure upload
76+
run: |
77+
PUBLISH="$PWD/publish"
78+
mkdir -p "$PUBLISH"
79+
80+
MONITOR="monitor_${{ github.run_id }}.txt"
81+
82+
# Create documentation upload files
83+
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
84+
ARCHIVE="legacy-addon-serial_modem-pr-${{ github.event.number }}.zip"
85+
echo "publish2 dev PR-${{ github.event.number }} ${ARCHIVE}" > "${MONITOR}"
86+
echo "${{ github.event.number }}" > pr.txt
87+
else
88+
ARCHIVE="legacy-addon-serial_modem-${VERSION}.zip"
89+
echo "publish2 main ${VERSION} ${ARCHIVE}" > "${MONITOR}"
90+
fi
91+
92+
pushd "doc/build/html"
93+
zip -rq "${ARCHIVE}" .
94+
mv "${ARCHIVE}" "$PUBLISH"
95+
popd
96+
97+
mv "${MONITOR}" "$PUBLISH"
98+
if [[ -f pr.txt ]]; then mv pr.txt "$PUBLISH"; fi
99+
100+
- name: Prepare Zoomin upload
101+
if: ${{ github.event_name == 'push' }}
102+
run: |
103+
PUBLISH="$PWD/publish"
104+
mkdir -p "$PUBLISH"
105+
106+
OUTDIR=doc/build/html
107+
ARCHIVE="addon-serial_modem_$VERSION.zip"
108+
109+
cp doc/custom.properties "$OUTDIR/custom.properties"
110+
sed -i 's/__VERSION__/'"$VERSION"'/g' "$OUTDIR/custom.properties"
111+
112+
cp doc/tags.yml "$OUTDIR/tags.yml"
113+
sed -i 's/__VERSION__/'"$VERSION"'/g' "$OUTDIR/tags.yml"
114+
115+
pushd "$OUTDIR"
116+
zip -rq "$ARCHIVE" .
117+
mv "$ARCHIVE" "$PUBLISH"
118+
popd
119+
120+
- name: Store
121+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'external') || contains(github.event.pull_request.labels.*.name, 'CI-trusted-author') }}
122+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
123+
with:
124+
name: docs
125+
retention-days: 5
126+
path: |
127+
publish/*

doc/conf.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
1111

1212
project = 'ncs-serial-modem'
13-
copyright = '2025, Nordic Semiconductor'
13+
copyright = '2026, Nordic Semiconductor'
1414
author = 'Nordic Semiconductor'
1515
release = '0.1.0'
1616

@@ -27,6 +27,8 @@
2727
'breathe',
2828
'sphinx_tabs.tabs',
2929
'sphinx_togglebutton',
30+
"sphinxcontrib.jquery",
31+
"sphinx_copybutton",
3032
]
3133

3234
templates_path = ['_templates']
@@ -36,6 +38,11 @@
3638
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
3739

3840
html_theme = 'sphinx_ncs_theme'
41+
html_show_sphinx = False
42+
43+
html_theme_options = {'docsets': {},"addons_url": "https://nrfconnect.github.io/ncs-app-index/","bare_metal_url": "","ncs_url": "https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/index.html", "ncs_label": "nRF Connect SDK Docs", "logo_url": "https://docs.nordicsemi.com"}
44+
45+
html_extra_path = ['versions.json']
3946

4047
## -- Options for Breathe ----------------------------------------------------
4148
# https://breathe.readthedocs.io/en/latest/index.html

doc/requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Sphinx==5.3.0
22
breathe==4.35.0
3-
sphinx-ncs-theme==0.7.4
3+
sphinx-ncs-theme<2.1
44
sphinx-tabs>=3.4
55
sphinx-togglebutton>=0.3.2
66
Pillow>=9.0.1
7+
sphinxcontrib.jquery
8+
sphinx-copybutton

doc/versions.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[
2+
"1.0.1",
3+
"1.0.0"
4+
]

0 commit comments

Comments
 (0)