Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Commit 04f248a

Browse files
authored
Merge pull request #965 from pohly/sphinx-dox-versioning
Sphinx dox versioning
2 parents 6bdf859 + 524addf commit 04f248a

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

.github/workflows/publish.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
branches:
66
- devel
77
- release-0.7
8+
- release-0.8
9+
- release-0.9
810

911
jobs:
1012
build:
@@ -23,16 +25,18 @@ jobs:
2325
run: |
2426
mkdir $HOME/output
2527
touch $HOME/output/.nojekyll
26-
# This is the static index page for https://intel.github.io/pmem-csi,
27-
# copied from the "devel" branch.
28-
cp docs/html/index2.html $HOME/output/index.html
28+
# https://intel.github.io/pmem-csi/ redirects to the latest stable release.
29+
echo "<meta http-equiv=\"refresh\" content=\"0; URL='0.9/index.html'\" />" >"$HOME/output/index.html"
30+
# "latest" used to be what "devel" is now, i.e. the documentation for the "devel"
31+
# branch. Now it points to the latest stable release.
32+
ln -s 0.9 "$HOME/output/latest"
2933
- name: Build latest
3034
run: |
3135
GITHUB_SHA=$(git rev-parse HEAD)
3236
export GITHUB_SHA
3337
rm -rf _work/venv
3438
make vhtml
35-
mv _output/html $HOME/output/latest
39+
mv _output/html $HOME/output/devel
3640
- uses: actions/checkout@v2
3741
with:
3842
ref: release-0.7

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ and bug fixes. Older releases are no longer supported.
1616

1717
Documentation is part of the source code for each release and also
1818
available in rendered form for easier reading:
19-
- [latest documentation, in development](https://intel.github.io/pmem-csi/latest/)
20-
- [latest 0.7.x release](https://intel.github.io/pmem-csi/0.7/)
21-
- [latest 0.8.x release](https://intel.github.io/pmem-csi/0.8/)
2219
- [latest 0.9.x release](https://intel.github.io/pmem-csi/0.9/)
20+
- [latest 0.8.x release](https://intel.github.io/pmem-csi/0.8/)
21+
- [latest 0.7.x release](https://intel.github.io/pmem-csi/0.7/)
22+
- [latest documentation, in development](https://intel.github.io/pmem-csi/devel/)
2323

2424
## Supported Kubernetes versions
2525

conf.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import json
33
import os
44
import sys
5+
import subprocess
56
from os import getenv
67
#support for modified code block
78
from pygments.lexers.shell import BashSessionLexer
@@ -29,6 +30,15 @@ class copyAllConsole (BashSessionLexer):
2930
for item in conf:
3031
globals()[item] = (conf[item])
3132

33+
# Dynamically determine the major version based on the branch name:
34+
# vx.y for release-x.y, "devel" for everything else
35+
branch = subprocess.check_output("git rev-parse --abbrev-ref HEAD".split(), encoding="utf-8")
36+
if branch.startswith("release-"):
37+
version = "v" + branch[len("release-"):].strip()
38+
else:
39+
version = "devel"
40+
release = version
41+
3242
sphinx_md_useGitHubURL = True
3343
baseBranch = "devel"
3444
commitSHA = getenv('GITHUB_SHA')
@@ -42,4 +52,4 @@ class copyAllConsole (BashSessionLexer):
4252
githubFileURL = githubFileURL + baseBranch + "/"
4353
githubDirURL = githubDirURL + baseBranch + "/"
4454
sphinx_md_githubFileURL = githubFileURL
45-
sphinx_md_githubDirURL = githubDirURL
55+
sphinx_md_githubDirURL = githubDirURL

0 commit comments

Comments
 (0)