Skip to content

Commit a4bae33

Browse files
committed
Use appropriate name for versioned website helper script
Now that the purpose of the versioned website helper script is exclusively to determine the versioning parameters, the previous "build.py" filename was not an accurate representation of its purpose.
1 parent b58b149 commit a4bae33

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

Taskfile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ tasks:
231231
deps:
232232
- task: poetry:install-deps
233233
cmds:
234-
- poetry run pytest workflow-templates/assets/deploy-mkdocs-versioned/build/tests
234+
- poetry run pytest workflow-templates/assets/deploy-mkdocs-versioned/siteversion/tests
235235

236236
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python-task/Taskfile.yml
237237
python:lint:

workflow-templates/assets/deploy-mkdocs-versioned/build/build.py renamed to workflow-templates/assets/deploy-mkdocs-versioned/siteversion/siteversion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Source:
2-
# https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/deploy-mkdocs-versioned/build/build.py
2+
# https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/deploy-mkdocs-versioned/siteversion/siteversion.py
33

44
# Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
55

@@ -89,7 +89,7 @@ def main():
8989

9090
# Usage:
9191
# To run the script (must be run from within the repo tree):
92-
# $python build.py
92+
# $python siteversion.py
9393
#
9494
if __name__ == "__main__":
9595
main()
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Source:
2-
# https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/deploy-mkdocs-versioned/build/test/test_all.py
2+
# https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/deploy-mkdocs-versioned/siteversion/test/test_all.py
33

44
# Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
55

@@ -12,22 +12,22 @@
1212
# modify or otherwise use the software for commercial activities involving the
1313
# Arduino software without disclosing the source code of your own applications.
1414
# To purchase a commercial license, send an email to [email protected].
15-
import build
15+
import siteversion
1616

1717

1818
def test_get_docs_version():
19-
data = build.get_docs_version("main", [])
19+
data = siteversion.get_docs_version("main", [])
2020
assert data["version"] == "dev"
2121
assert data["alias"] == ""
2222

2323
release_names = ["1.4.x", "0.13.x"]
24-
data = build.get_docs_version("0.13.x", release_names)
24+
data = siteversion.get_docs_version("0.13.x", release_names)
2525
assert data["version"] == "0.13"
2626
assert data["alias"] == ""
27-
data = build.get_docs_version("1.4.x", release_names)
27+
data = siteversion.get_docs_version("1.4.x", release_names)
2828
assert data["version"] == "1.4"
2929
assert data["alias"] == "latest"
3030

31-
data = build.get_docs_version("0.1.x", [])
31+
data = siteversion.get_docs_version("0.1.x", [])
3232
assert data["version"] is None
3333
assert data["alias"] is None

workflow-templates/dependabot/workflow-template-copies/.github/workflows/deploy-mkdocs-versioned-poetry.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: Deploy Website
44
on:
55
push:
66
branches:
7-
# Branch to base "dev" website on. Set in build.py also.
7+
# Branch to base "dev" website on. Set in siteversion.py also.
88
- main
99
# Release branches have names like 0.8.x, 0.9.x, ...
1010
- "[0-9]+.[0-9]+.x"
@@ -66,7 +66,7 @@ jobs:
6666

6767
- name: Determine versioning parameters
6868
id: determine-versioning
69-
run: echo "::set-output name=data::$(poetry run python docs/build/build.py)"
69+
run: echo "::set-output name=data::$(poetry run python docs/siteversion/siteversion.py)"
7070

7171
- name: Publish documentation
7272
if: fromJson(steps.determine-versioning.outputs.data).version != null

workflow-templates/deploy-mkdocs-versioned-poetry.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ The website version is selectable via a menu on the website as well as the URL o
2020
- [deploy-mkdocs-versioned-poetry.yml](deploy-mkdocs-versioned-poetry.yml) - GitHub Actions workflow
2121
- Install to: `.github/workflows/`
2222
- Base assets - See the ["Deploy Website" workflow (MkDocs, Poetry) documentation](deploy-mkdocs-poetry.md#assets)
23-
- [build](assets/deploy-mkdocs-versioned/build/) - versioning helper script.
24-
- Install to: `docs/build/`
23+
- [siteversion](assets/deploy-mkdocs-versioned/siteversion/) - versioning helper script.
24+
- Install to: `docs/siteversion/`
2525
- [`Taskfile.yml`](assets/deploy-mkdocs-versioned/Taskfile.yml) - website deployment task
2626
- Install to: repository root (or merge into the existing `Taskfile.yml`)
2727

@@ -38,7 +38,7 @@ See the ["Deploy Website" workflow (MkDocs, Poetry) documentation](deploy-mkdocs
3838
The system is configured for the repository branch used as the source for the "dev" website version having the name `main`. If the project's development branch has another name, then configure it:
3939

4040
- `on.push.branches[0]` in `deploy-mkdocs-versioned-poetry.yml`
41-
- `DEV_BRANCHES` in [`build/build.py`](assets/deploy-mkdocs-versioned/build/build.py)
41+
- `DEV_BRANCHES` in [`siteversion/siteversion.py`](assets/deploy-mkdocs-versioned/siteversion/siteversion.py)
4242

4343
#### Configure Material theme for versioning
4444

workflow-templates/deploy-mkdocs-versioned-poetry.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: Deploy Website
44
on:
55
push:
66
branches:
7-
# Branch to base "dev" website on. Set in build.py also.
7+
# Branch to base "dev" website on. Set in siteversion.py also.
88
- main
99
# Release branches have names like 0.8.x, 0.9.x, ...
1010
- "[0-9]+.[0-9]+.x"
@@ -66,7 +66,7 @@ jobs:
6666

6767
- name: Determine versioning parameters
6868
id: determine-versioning
69-
run: echo "::set-output name=data::$(poetry run python docs/build/build.py)"
69+
run: echo "::set-output name=data::$(poetry run python docs/siteversion/siteversion.py)"
7070

7171
- name: Publish documentation
7272
if: fromJson(steps.determine-versioning.outputs.data).version != null

0 commit comments

Comments
 (0)