1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

Merge pull request #29507 from abderrahim/doc-sync-improvement

Improvements to the doc-sync target
This commit is contained in:
Luca Boccassi 2023-10-10 08:59:33 +01:00 committed by GitHub
commit 795e80c7ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 8 deletions

View File

@ -23,5 +23,6 @@ SPDX-License-Identifier: LGPL-2.1-or-later
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. [FINAL] Push commits to stable, create an empty -stable branch: `git push systemd-stable --atomic origin/main:main origin/main:refs/heads/${version}-stable`, and change the default branch to latest release (https://github.com/systemd/systemd-stable/settings/branches).
18. [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'
17. Push commits to stable, create an empty -stable branch: `git push systemd-stable --atomic origin/main:main origin/main:refs/heads/${version}-stable`.
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'

View File

@ -81,7 +81,17 @@ def update_index_file(version, index_filename):
json.dump(index, f)
def main(version, directory, www_target, latest):
def get_latest_version():
tags = subprocess.check_output(["git", "tag", "-l", "v*"], text=True).split()
versions = []
for tag in tags:
m = re.match("v?(\d+).*", tag)
if m:
versions.append(int(m.group(1)))
return max(versions)
def main(version, directory, www_target):
index_filename = os.path.join(directory, "index.json")
nav_filename = os.path.join(directory, "nav.js")
@ -95,7 +105,7 @@ def main(version, directory, www_target, latest):
dirs = [version]
if latest:
if int(version) == get_latest_version():
dirs.append("latest")
for d in dirs:
@ -108,7 +118,7 @@ def main(version, directory, www_target, latest):
"--exclude=*",
"--omit-dir-times",
directory + "/", # copy contents of directory
os.path.join(www_target, d),
os.path.join(www_target, "man", d),
]
)
@ -118,7 +128,7 @@ def main(version, directory, www_target, latest):
"-v",
os.path.join(directory, "index.json"),
os.path.join(directory, "nav.js"),
www_target,
os.path.join(www_target, "man"),
]
)
@ -126,9 +136,8 @@ def main(version, directory, www_target, latest):
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("--version", required=True)
parser.add_argument("--no-latest", dest="latest", action="store_false")
parser.add_argument("directory")
parser.add_argument("www_target")
args = parser.parse_args()
main(args.version, args.directory, args.www_target, args.latest)
main(args.version, args.directory, args.www_target)