diff --git a/.github/workflows/cd_release.yml b/.github/workflows/cd_release.yml index 8e732de1..bd37cd31 100644 --- a/.github/workflows/cd_release.yml +++ b/.github/workflows/cd_release.yml @@ -119,6 +119,13 @@ on: type: string default: "" + # MkDocs + mkdocs_update_latest: + description: "Whether or not to update the 'latest' alias to point to `release_branch`. Defaults to 'true'." + required: false + type: boolean + default: true + # Sphinx sphinx-build_options: description: "Single (space-separated) or multi-line string of command-line options to use when calling `sphinx-build`." @@ -384,8 +391,13 @@ jobs: if [ "${{ inputs.test }}" == "true" ]; then if [ "${{ inputs.docs_framework }}" == "mkdocs" ]; then - echo "Will here deploy documentation using 'mike', first one called '${REF#v}' with alias 'stable'" - echo "Then one called 'latest' with alias '${{ inputs.release_branch }}'" + echo "Will here deploy documentation using 'mike': '${REF#v}' with alias 'stable'" + echo "Release 'latest': ${{ inputs.mkdocs_update_latest }}" + if [ "${{ inputs.mkdocs_update_latest }}" == "true" ]; then + echo " Another release: 'latest' with alias '${{ inputs.release_branch }}'" + else + echo " No other release." + fi elif [ "${{ inputs.docs_framework }}" == "sphinx" ]; then echo "Will here deploy documentation using 'sphinx-build'." echo "sphinx-build options: ${SPHINX_OPTIONS[@]}" @@ -399,7 +411,9 @@ jobs: elif [ "${{ inputs.docs_framework }}" == "mkdocs" ]; then mike deploy --push --remote origin --branch gh-pages --update-aliases --config-file mkdocs.yml ${REF#v} stable - mike deploy --push --remote origin --branch gh-pages --update-aliases --config-file mkdocs.yml latest ${{ inputs.release_branch }} + if [ "${{ inputs.mkdocs_update_latest }}" == "true" ]; then + mike deploy --push --remote origin --branch gh-pages --update-aliases --config-file mkdocs.yml latest ${{ inputs.release_branch }} + fi elif [ "${{ inputs.docs_framework }}" == "sphinx" ]; then sphinx-build \ diff --git a/docs/workflows/cd_release.md b/docs/workflows/cd_release.md index 66a201ea..d54c2a66 100644 --- a/docs/workflows/cd_release.md +++ b/docs/workflows/cd_release.md @@ -82,7 +82,7 @@ Inputs related to updating the version, building and releasing the Python packag |:--- |:--- |:---:|:---:|:---:| | `python_package` | Whether or not this is a Python package, where the version should be updated in the `'package_dir'/__init__.py` for the possibly several 'package_dir' lines given in the `package_dirs` input and a build and release to PyPI should be performed. | No | `true` | _boolean_ | | `python_version_build` | The Python version to use for the workflow when building the package. | No | 3.9 | _string_ | -| `package_dirs` | A multi-line string of paths to Python package directories relative to the repository directory to have its `__version__` value updated.

Example: `'src/my_package'`.

**Important**: This is _required_ if 'python_package' is 'true', which is the default.

See also [Single vs multi-line input](index.md#single-vs-multi-line-input). | **_Yes_ (if 'python_package' is 'true'** | | _string_ | +| `package_dirs` | A multi-line string of paths to Python package directories relative to the repository directory to have its `__version__` value updated.

Example: `'src/my_package'`.

**Important**: This is _required_ if 'python_package' is 'true', which is the default.

See also [Single vs multi-line input](index.md#single-vs-multi-line-input). | **_Yes_ (if 'python_package' is 'true')** | | _string_ | | `version_update_changes` | A multi-line string of changes to be implemented in the repository files upon updating the version. The string should be made up of three parts: 'file path', 'pattern', and 'replacement string'. These are separated by the 'version_update_changes_separator' value.
The 'file path' must _always_ either be relative to the repository root directory or absolute.
The 'pattern' should be given as a 'raw' Python string.

See also [Single vs multi-line input](index.md#single-vs-multi-line-input). | No | _Empty string_ | _string_ | | `version_update_changes_separator` | The separator to use for 'version_update_changes' when splitting the three parts of each string. | No | , | _string_ | | `build_libs` | A space-separated list of packages to install via PyPI (`pip install`). | No | _Empty string_ | _string_ | @@ -92,7 +92,7 @@ Inputs related to updating the version, building and releasing the Python packag | `changelog_exclude_labels` | Comma-separated list of labels to exclude from the CHANGELOG.md. | No | _Empty string_ | _string_ | | `publish_on_pypi` | Whether or not to publish on PyPI.

**Note**: This is only relevant if 'python_package' is 'true', which is the default. | No | `true` | _boolean_ | -Inputs related to building and releasing the documentation. +Inputs related to building and releasing the documentation in general. | **Name** | **Description** | **Required** | **Default** | **Type** | |:--- |:--- |:---:|:---:|:---:| @@ -102,7 +102,13 @@ Inputs related to building and releasing the documentation. | `docs_framework` | The documentation framework to use. This can only be either `'mkdocs'` or `'sphinx'`. | No | mkdocs | _string_ | | `system_dependencies` | A single (space-separated) or multi-line string of Ubuntu APT packages to install prior to building the documentation.

See also [Single vs multi-line input](index.md#single-vs-multi-line-input). | No | _Empty string_ | _string_ | -Finally, inputs related _only_ to the Sphinx framework when building and releasing the documentation. +Inputs related _only_ to the **MkDocs** framework. + +| **Name** | **Description** | **Required** | **Default** | **Type** | +|:--- |:--- |:---:|:---:|:---:| +| `mkdocs_update_latest` | Whether or not to update the 'latest' alias to point to `release_branch`. | No | `true` | _boolean_ | + +Finally, inputs related _only_ to the **Sphinx** framework. | **Name** | **Description** | **Required** | **Default** | **Type** | |:--- |:--- |:---:|:---:|:---:|