]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
doc-sync: add support for uploading the documentation for main
authorAbderrahim Kitouni <abderrahim.kitouni@codethink.co.uk>
Mon, 9 Oct 2023 19:28:27 +0000 (20:28 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 10 Oct 2023 16:50:04 +0000 (17:50 +0100)
It will refuse running on any other branch than main or stable branches.

Also update the release instructions to run it on the stable branch.

docs/RELEASE.md
tools/sync-docs.py

index 744efcdd705db3153adb0d27e81e245aa5ad9a23..0fa86eda1ff4169c525f7d5658300e19b1ea1fcf 100644 (file)
@@ -18,11 +18,11 @@ SPDX-License-Identifier: LGPL-2.1-or-later
 9. Tag the release: `version=vXXX-rcY && git tag -s "${version}" -m "systemd ${version}"`
 10. Do `ninja -C build`
 11. Make sure that the version string and package string match: `build/systemctl --version`
-12. Upload the documentation: `ninja -C build doc-sync`
-13. [FINAL] Close the github milestone and open a new one (https://github.com/systemd/systemd/milestones)
-14. "Draft" a new release on github (https://github.com/systemd/systemd/releases/new), mark "This is a pre-release" if appropriate.
-15. Check that announcement to systemd-devel, with a copy&paste from NEWS, was sent. This should happen automatically.
-16. Update IRC topic (`/msg chanserv TOPIC #systemd Version NNN released`)
-17. Push commits to stable, create an empty -stable branch: `git push systemd-stable --atomic origin/main:main origin/main:refs/heads/${version}-stable`.
+12. [FINAL] Close the github milestone and open a new one (https://github.com/systemd/systemd/milestones)
+13. "Draft" a new release on github (https://github.com/systemd/systemd/releases/new), mark "This is a pre-release" if appropriate.
+14. Check that announcement to systemd-devel, with a copy&paste from NEWS, was sent. This should happen automatically.
+15. Update IRC topic (`/msg chanserv TOPIC #systemd Version NNN released`)
+16. Push commits to stable, create an empty -stable branch: `git push systemd-stable --atomic origin/main:main origin/main:refs/heads/${version}-stable`.
+17. Build and upload the documentation (on the -stable branch): `ninja -C build doc-sync`
 18. [FINAL] Change the default branch to latest release (https://github.com/systemd/systemd-stable/settings/branches).
 19. [FINAL] Change the Github Pages branch in the stable repository to the newly created branch (https://github.com/systemd/systemd-stable/settings/pages) and set the 'Custom domain' to 'systemd.io'
index edf9767f44032a10e02104a468b664114e9e799b..95436e2710a09928b371971ad33979129187e213 100755 (executable)
@@ -95,19 +95,27 @@ def main(version, directory, www_target):
     index_filename = os.path.join(directory, "index.json")
     nav_filename = os.path.join(directory, "nav.js")
 
+    current_branch = subprocess.check_output(["git", "branch", "--show-current"], text=True).strip()
+
+    if current_branch != 'main' and not current_branch.endswith("-stable"):
+        sys.exit("doc-sync should only be run from main or a stable branch")
+
     for filename in glob.glob(os.path.join(directory, "*.html")):
         process_file(filename)
 
+    if current_branch == "main":
+        version = "devel"
+        dirs = ["devel"]
+    elif int(version) == get_latest_version():
+        dirs = [version, "latest"]
+    else:
+        dirs = [version]
+
     with open(nav_filename, "w") as f:
         f.write(NAV_JS)
 
     update_index_file(version, index_filename)
 
-    dirs = [version]
-
-    if int(version) == get_latest_version():
-        dirs.append("latest")
-
     for d in dirs:
         subprocess.check_call(
             [