File tree Expand file tree Collapse file tree 5 files changed +40
-6
lines changed
Expand file tree Collapse file tree 5 files changed +40
-6
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ tag = True
88search = version = release = ' {current_version}'
99replace = version = release = ' {new_version}'
1010
11+ [bumpversion:file:docs/doc_versions.txt]
12+ search = {current_version}
13+ replace = {new_version}
14+ {current_version}
15+
1116[bumpversion:file:src/compas_fab/__version__.py]
1217search = __version__ = ' {current_version}'
1318replace = __version__ = ' {new_version}'
Original file line number Diff line number Diff line change @@ -25,14 +25,27 @@ jobs:
2525 - name : Install
2626 run : |
2727 python -m pip install --no-cache-dir -r requirements-dev.txt
28- - name : Get branch/tag name
29- id : get-branch
30- uses : ypicard/get-branch-name-github-action@v1
3128 - name : Generate docs
3229 if : ${{ success() }}
3330 run : |
3431 invoke docs
35- mkdir -p deploy/compas_fab/${{ steps.get-branch.outputs.tag }} && mv -T dist/docs deploy/compas_fab/${{ steps.get-branch.outputs.tag }}/
32+
33+ # Get branch/tag/latest name from git
34+ GITHUB_REF_REGEX="tags/([0-9a-zA-Z\.\-]+)|(pull/[0-9]+)|heads/(.+)"
35+
36+ if [[ $GITHUB_REF =~ $GITHUB_REF_REGEX ]]; then
37+ if [[ $BASH_REMATCH = pull* ]]; then
38+ BRANCH_OR_TAG=pull_${BASH_REMATCH##*/}
39+ else
40+ BRANCH_OR_TAG=${BASH_REMATCH##*/}
41+ fi;
42+ if [[ $BRANCH_OR_TAG = master ]]; then
43+ BRANCH_OR_TAG=latest
44+ fi;
45+ fi;
46+
47+ echo "Docs will be deployed to https://gramaziokohler.github.io/compas_fab/$BRANCH_OR_TAG"
48+ mkdir -p deploy/compas_fab/$BRANCH_OR_TAG && mv -T dist/docs deploy/compas_fab/$BRANCH_OR_TAG/
3649 - name : Deploy docs
3750 if : success()
3851 uses : crazy-max/ghaction-github-pages@v2
Original file line number Diff line number Diff line change 5959# autosummary options
6060autosummary_generate = True
6161
62+ # collect doc versions
63+ package_docs_root = 'https://gramaziokohler.github.io/compas_fab/'
64+
65+ with open (os .path .join (os .path .dirname (__file__ ), 'doc_versions.txt' ), 'r' ) as f :
66+ version_names = [version .strip () for version in f .readlines ()]
67+ package_docs_versions = [(version , '{}{}' .format (package_docs_root , version ))
68+ for version in version_names if version ]
69+
6270# on_rtd is whether we are on readthedocs.org
6371on_rtd = os .environ .get ('READTHEDOCS' , None ) == 'True'
6472html_theme = 'compaspkg'
6876 "package_title" : project ,
6977 "package_version" : release ,
7078 "package_repo" : 'https://github.com/compas-dev/compas_fab' ,
79+ "package_docs" : package_docs_root ,
80+ "package_old_versions" : package_docs_versions
7181}
7282
7383html_split_index = False
Original file line number Diff line number Diff line change 1+ latest
2+ stable
3+ 0.11.0
4+ 0.10.1
5+ 0.10.0
6+ 0.1.0
Original file line number Diff line number Diff line change 11attrs >= 19.3.0
2- sphinx_compas_theme >= 0.4
2+ sphinx_compas_theme >= 0.9
33sphinx >= 1.6
44invoke >= 0.14
5- bump2version >= 0.5.11
5+ bump2version >= 1.0
66check-manifest >= 0.36
77flake8
88autopep8
You can’t perform that action at this time.
0 commit comments