File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,8 @@ name: Build Sphinx docs and deploy to GitHub Pages
2
2
3
3
# Generate the documentation on all merges to main, all pull requests, or by
4
4
# manual workflow dispatch. The build job can be used as a CI check that the
5
- # docs still build successfully. The deploy job only runs when merging
6
- # to main and actually moves the generated html to the gh-pages branch
7
- # (which triggers a GitHub pages deployment).
5
+ # docs still build successfully. The deploy job only runs when a tag is pushed
6
+ # (so, when a new release is made).
8
7
on :
9
8
push :
10
9
branches :
38
37
needs : build_sphinx_docs
39
38
permissions :
40
39
contents : write
41
- if : github.event_name == 'push' && github.ref_name == 'main '
40
+ if : github.event_name == 'push' && github.ref_type == 'tag '
42
41
runs-on : ubuntu-latest
43
42
steps :
44
43
- uses : neuroinformatics-unit/actions/deploy_sphinx_docs@v2
Original file line number Diff line number Diff line change @@ -3,5 +3,6 @@ myst-parser
3
3
nbsphinx
4
4
numpydoc
5
5
pydata-sphinx-theme
6
+ setuptools-scm
6
7
sphinx
7
8
sphinx-design
Original file line number Diff line number Diff line change 16
16
17
17
18
18
# -- Project information -----------------------------------------------------
19
+ import setuptools_scm
19
20
20
21
project = 'NeuroBlueprint'
21
22
copyright = '2022, UCL'
22
23
author = 'Neuroinformatics Unit'
23
24
24
- # The full version, including alpha/beta/rc tags
25
- release = '0.1.0'
25
+ # Retrieve the version number from the package
26
+ try :
27
+ release = setuptools_scm .get_version (root = "../.." , relative_to = __file__ )
28
+ release = release .split (".dev" )[0 ] # remove dev tag and git hash
29
+ except LookupError :
30
+ # if git is not initialised, still allow local build
31
+ # with a dummy version
32
+ release = "0.0.0"
26
33
27
34
28
35
# -- General configuration ---------------------------------------------------
You can’t perform that action at this time.
0 commit comments