gen_release_notes: include links in relnotes.rst when generating the new release note
This is required to allow the docs to build, which in turn is required if we want to allow merge requests against release (staging) branches. Cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20460>
This commit is contained in:

committed by
Marge Bot

parent
13af997567
commit
b3f517b988
@@ -27,31 +27,6 @@ import pathlib
|
||||
import subprocess
|
||||
|
||||
|
||||
def update_release_notes(version: str) -> None:
|
||||
p = pathlib.Path('docs') / 'relnotes.rst'
|
||||
|
||||
with open(p, 'r') as f:
|
||||
relnotes = f.readlines()
|
||||
|
||||
new_relnotes = []
|
||||
first_list = True
|
||||
second_list = True
|
||||
for line in relnotes:
|
||||
if first_list and line.startswith('-'):
|
||||
first_list = False
|
||||
new_relnotes.append(f'- :doc:`{version} release notes <relnotes/{version}>`\n')
|
||||
if not first_list and second_list and line.startswith(' relnotes/'):
|
||||
second_list = False
|
||||
new_relnotes.append(f' relnotes/{version}\n')
|
||||
new_relnotes.append(line)
|
||||
|
||||
with open(p, 'w') as f:
|
||||
for line in new_relnotes:
|
||||
f.write(line)
|
||||
|
||||
subprocess.run(['git', 'add', p])
|
||||
|
||||
|
||||
def update_calendar(version: str) -> None:
|
||||
p = pathlib.Path('docs') / 'release-calendar.csv'
|
||||
|
||||
@@ -81,14 +56,9 @@ def main() -> None:
|
||||
args = parser.parse_args()
|
||||
|
||||
update_calendar(args.version)
|
||||
done = 'update calendar'
|
||||
|
||||
if 'rc' not in args.version:
|
||||
update_release_notes(args.version)
|
||||
done += ' and link releases notes'
|
||||
|
||||
subprocess.run(['git', 'commit', '-m',
|
||||
f'docs: {done} for {args.version}'])
|
||||
f'docs: update calendar for {args.version}'])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Reference in New Issue
Block a user