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_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(
[