Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 0 additions & 116 deletions .github/workflows/doc-build-and-publish-zoomin.yml

This file was deleted.

127 changes: 127 additions & 0 deletions .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: Documentation Build

permissions:
contents: read

on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
- 'v*-branch'
paths:
- '.github/workflows/doc-build.yml'
- '.github/workflows/doc-publish.yml'
- '**.rst'
- 'doc/**'
- "include/**"
push:
branches:
- main
- 'v*-branch'
tags:
- v*

env:
DOXYGEN_VERSION: 1.12.0

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Install system dependencies
run: |
wget --no-verbose "https://github.com/doxygen/doxygen/releases/download/Release_${DOXYGEN_VERSION//./_}/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz"
sudo tar xf doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz -C /opt
echo "/opt/doxygen-${DOXYGEN_VERSION}/bin" >> $GITHUB_PATH

- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: 3.12
cache: pip
cache-dependency-path: doc/requirements.txt
pip-install: |
-r doc/requirements.txt

- name: Build
working-directory: doc
run: |
doxygen
sphinx-build -M html . build

- name: Check version
run: |
VERSION_REGEX="^v([0-9a-zA-Z\.\-]+)$"
if [[ ${GITHUB_REF#refs/tags/} =~ $VERSION_REGEX ]]; then
VERSION=${BASH_REMATCH[1]}
elif [[ ${GITHUB_REF#refs/heads/} == "main" ]]; then
VERSION="latest"
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
VERSION="pr-${{ github.event.number }}"
fi
echo "VERSION=${VERSION}"
echo "VERSION=${VERSION}" >> "$GITHUB_ENV"

- name: Prepare Azure upload
run: |
PUBLISH="$PWD/publish"
mkdir -p "$PUBLISH"

MONITOR="monitor_${{ github.run_id }}.txt"

# Create documentation upload files
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
ARCHIVE="legacy-addon-serial_modem-pr-${{ github.event.number }}.zip"
echo "publish2 dev PR-${{ github.event.number }} ${ARCHIVE}" > "${MONITOR}"
echo "${{ github.event.number }}" > pr.txt
else
ARCHIVE="legacy-addon-serial_modem-${VERSION}.zip"
echo "publish2 main ${VERSION} ${ARCHIVE}" > "${MONITOR}"
fi

pushd "doc/build/html"
zip -rq "${ARCHIVE}" .
mv "${ARCHIVE}" "$PUBLISH"
popd

mv "${MONITOR}" "$PUBLISH"
if [[ -f pr.txt ]]; then mv pr.txt "$PUBLISH"; fi

- name: Prepare Zoomin upload
if: ${{ github.event_name == 'push' }}
run: |
PUBLISH="$PWD/publish"
mkdir -p "$PUBLISH"

OUTDIR=doc/build/html
ARCHIVE="addon-serial_modem_$VERSION.zip"

cp doc/custom.properties "$OUTDIR/custom.properties"
sed -i 's/__VERSION__/'"$VERSION"'/g' "$OUTDIR/custom.properties"

cp doc/tags.yml "$OUTDIR/tags.yml"
sed -i 's/__VERSION__/'"$VERSION"'/g' "$OUTDIR/tags.yml"

pushd "$OUTDIR"
zip -rq "$ARCHIVE" .
mv "$ARCHIVE" "$PUBLISH"
popd

- name: Store
if: ${{ !contains(github.event.pull_request.labels.*.name, 'external') || contains(github.event.pull_request.labels.*.name, 'CI-trusted-author') }}
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: docs
retention-days: 5
path: |
publish/*
9 changes: 8 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'ncs-serial-modem'
copyright = '2025, Nordic Semiconductor'
copyright = '2026, Nordic Semiconductor'
author = 'Nordic Semiconductor'
release = '0.1.0'

Expand All @@ -27,6 +27,8 @@
'breathe',
'sphinx_tabs.tabs',
'sphinx_togglebutton',
"sphinxcontrib.jquery",
"sphinx_copybutton",
]

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

html_theme = 'sphinx_ncs_theme'
html_show_sphinx = False

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"}

html_extra_path = ['versions.json']

## -- Options for Breathe ----------------------------------------------------
# https://breathe.readthedocs.io/en/latest/index.html
Expand Down
4 changes: 3 additions & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Sphinx==5.3.0
breathe==4.35.0
sphinx-ncs-theme==0.7.4
sphinx-ncs-theme<2.1
sphinx-tabs>=3.4
sphinx-togglebutton>=0.3.2
Pillow>=9.0.1
sphinxcontrib.jquery
sphinx-copybutton
4 changes: 4 additions & 0 deletions doc/versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
"1.0.1",
"1.0.0"
]
Loading