Skip to content

Commit f413f0e

Browse files
authored
Fix nightly (#425)
fix nightly builds: * GH Actions: tidy and fix nightly build failure * Switch to using `version` instead of `release` for conda pins * Nightly builds: bring back `nightly.CCYY-MM-DD` version name in sidebar * Bump cylc-sphinx-extensions
1 parent 933e530 commit f413f0e

File tree

17 files changed

+64
-53
lines changed

17 files changed

+64
-53
lines changed

.github/actions/create-conda-envs/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ runs:
3939
# TODO: add explicit python dep
4040
sed \
4141
-e 's/python =.*/python =${{ inputs.python_version }}/' \
42-
-e "s/|release|/${CYLC_RELEASE}/" \
42+
-e "s/|version|/${CYLC_RELEASE}/" \
4343
"${env_file}" \
4444
> "${new_env_file}"
4545
# create the env
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Install libs to document
2+
description: Install Cylc libs and Rose
3+
4+
inputs:
5+
# If these are not specified, they fall back to the workflow_dispatch input
6+
# values, or failing that, 'master'
7+
cylc-flow-tag:
8+
description: 'cylc-flow github release tag (must be present in cylc-docs)'
9+
required: false
10+
cylc-rose-tag:
11+
description: 'cylc-rose github release tag'
12+
required: false
13+
cylc-uis-tag:
14+
description: 'cylc-uiserver github release tag'
15+
required: false
16+
metomi-rose-tag:
17+
description: 'rose github release tag (currently only affects cylc-rose install)'
18+
required: false
19+
20+
runs:
21+
using: composite
22+
steps:
23+
- shell: bash
24+
env:
25+
cylc_flow: ${{ inputs.cylc-flow-tag || github.event.inputs.cylc-flow-tag || 'master' }}
26+
meto_rose: ${{ inputs.metomi-rose-tag || github.event.inputs.metomi-rose-tag || 'master' }}
27+
cylc_rose: ${{ inputs.cylc-rose-tag || github.event.inputs.cylc-rose-tag || 'master' }}
28+
cylc_uis: ${{ inputs.cylc-uis-tag || github.event.inputs.cylc-uis-tag || 'master' }}
29+
run: |
30+
pip install \
31+
"cylc-flow[all] @ git+https://github.com/cylc/cylc-flow@${cylc_flow}" \
32+
"cylc-uiserver[all] @ git+https://github.com/cylc/cylc-uiserver@${cylc_uis}" \
33+
"metomi-rose[all] @ git+https://github.com/metomi/rose@${meto_rose}" \
34+
"cylc-rose[all] @ git+https://github.com/cylc/cylc-rose@${cylc_rose}"
35+
# NOTE: Install with [all] so we can import plugins which may
36+
# have extra dependencies.

.github/workflows/deploy.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ on:
5050
description: "Don't fail if the conda environments fail to build."
5151
type: boolean
5252
default: false
53+
required: false
5354

5455
jobs:
5556
deploy:
@@ -74,20 +75,7 @@ jobs:
7475
run: pip install "${{ github.workspace }}/docs[all]"
7576

7677
- name: install libs to document
77-
env:
78-
cylc_flow: ${{ github.event.inputs.cylc-flow-tag }}
79-
meto_rose: ${{ github.event.inputs.metomi-rose-tag }}
80-
cylc_rose: ${{ github.event.inputs.cylc-rose-tag }}
81-
cylc_uis: ${{ github.event.inputs.cylc-uis-tag }}
82-
run: |
83-
# NOTE: Install with [all] so we can import plugins which may
84-
# have extra dependencies.
85-
pip install \
86-
"cylc-flow[all] @ git+https://github.com/cylc/cylc-flow@${cylc_flow}" \
87-
"cylc-rose[all] @ git+https://github.com/cylc/cylc-rose@${cylc_rose}" \
88-
"cylc-uiserver[all] @ git+https://github.com/cylc/cylc-uiserver@${cylc_uis}"
89-
git clone --depth 1 --branch "${meto_rose}" https://github.com/metomi/rose ../rose
90-
pip install -e ../rose[all]
78+
uses: cylc/cylc-doc/.github/actions/install-libs@master
9179

9280
- name: create conda envs
9381
uses: ./docs/.github/actions/create-conda-envs

.github/workflows/nightly.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,7 @@ jobs:
4848
run: pip install "${{ github.workspace }}/docs[all]"
4949

5050
- name: install libs to document
51-
run: |
52-
# NOTE: Install with [all] so we can import plugins which may
53-
# have extra dependencies.
54-
pip install \
55-
'cylc-flow[all] @ git+https://github.com/cylc/cylc-flow@master' \
56-
'cylc-rose[all] @ git+https://github.com/cylc/cylc-rose@master' \
57-
'cylc-uiserver[all] @ git+https://github.com/cylc/cylc-uiserver@master'
58-
git clone --depth 1 https://github.com/metomi/rose ../rose
59-
pip install -e ../rose[all]
51+
uses: ./docs/.github/actions/install-libs
6052

6153
- name: checkout gh-pages branch
6254
uses: actions/checkout@v2
@@ -105,15 +97,15 @@ jobs:
10597
10698
- name: build docs
10799
run: |
100+
version="nightly.$(isodatetime --utc -f %Y-%m-%d)"
108101
make -C docs \
109102
html \
110103
slides \
111104
linkcheck \
112-
SPHINXOPTS='-Wn' \
105+
SPHINXOPTS="-Wn -A sidebar_version_name=${version}" \
113106
STABLE=false \
114107
LATEST=false \
115-
BUILDDIR='doc/nightly' \
116-
CYLC_VERSION="nightly.$(isodatetime --utc -f %Y-%m-%d)"
108+
BUILDDIR='doc/nightly'
117109
git -C gh-pages add 'nightly' 'versions.json'
118110
119111
- name: push changes

.github/workflows/test.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,7 @@ jobs:
4444
run: pip install .[all]
4545

4646
- name: install libs to document
47-
env:
48-
cylc_flow: ${{ github.event.inputs.cylc-flow-tag || 'master' }}
49-
meto_rose: ${{ github.event.inputs.metomi-rose-tag || 'master' }}
50-
cylc_rose: ${{ github.event.inputs.cylc-rose-tag || 'master' }}
51-
cylc_uis: ${{ github.event.inputs.cylc-uis-tag || 'master' }}
52-
run: |
53-
# NOTE: Install with [all] so we can import plugins which may
54-
# have extra dependencies.
55-
pip install \
56-
"cylc-flow[all] @ git+https://github.com/cylc/cylc-flow@${cylc_flow}" \
57-
"cylc-uiserver[all] @ git+https://github.com/cylc/cylc-uiserver@${cylc_uis}" \
58-
"metomi-rose[all] @ git+https://github.com/metomi/rose@${meto_rose}" \
59-
"cylc-rose[all] @ git+https://github.com/cylc/cylc-rose@${cylc_rose}"
47+
uses: ./.github/actions/install-libs
6048

6149
- name: install eslint
6250
run: |

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ packages = find_namespace:
4848
include_package_data = True
4949
python_requires = >=3.7
5050
install_requires =
51-
cylc-sphinx-extensions>=1.3.4
51+
cylc-sphinx-extensions>=1.3.5
5252
eralchemy==1.2.*
5353
hieroglyph>=2.1.0
5454
setuptools>=50

src/_templates/versions.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
></div>
1010

1111
{% set ROOT_DIR = pathto('').rsplit('.html', 1)[0] + '../..' %}
12+
{% set CUR_VERSION = sidebar_version_name if sidebar_version_name else release %}
1213

1314
<script type="text/javascript">
1415
const CUR_FORMAT = "{{ builder }}";
15-
const CUR_VERSION = "{{ release }}";
16+
const CUR_VERSION = "{{ CUR_VERSION }}";
1617
// name of page (in URL), for singlepage builds this will be `index`
1718
const PAGE_NAME = "{{ current_page_name }}";
1819
// URL path to the base docs dir i.e. ROOT_DIR/version/format

src/conf.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@
165165
],
166166
}
167167

168+
# Values to pass into the templating context. Can be overridden using the
169+
# sphinx-build opt `-A name=value` (add to SPHINXOPTS if using make).
170+
html_context = {
171+
'sidebar_version_name': None, # override name in version picker
172+
}
173+
168174
html_static_path = ['_static']
169175

170176
# These paths are either relative to html_static_path
@@ -229,5 +235,5 @@
229235

230236
literal_sub_include_subs = {
231237
'version': version,
232-
'release': release.replace('.dev', ''),
238+
'release': release,
233239
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: cylc-|release|
1+
name: cylc-|version|
22
channels:
33
- conda-forge
44
dependencies:
5-
- cylc-flow =|release|
5+
- cylc-flow =|version|
66
- cylc-uiserver
77
- cylc-rose
88
- metomi-rose

src/reference/environments/envs/cylc-flow-anaconda.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ channels:
44
- conda-forge
55
dependencies:
66
- python
7-
- cylc-flow =|release|
7+
- cylc-flow =|version|

0 commit comments

Comments
 (0)