When preparing for an actual release, strip UNRELEASED from the release notes

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2023-02-18 17:57:05 +00:00 committed by Pedro Algarvio
parent fb8cd8623f
commit 60cec955c1
3 changed files with 12 additions and 5 deletions

View file

@ -290,8 +290,8 @@ jobs:
- name: Update Release Notes
shell: bash
run: |
tools changelog update-release-notes --draft
tools changelog update-release-notes
tools changelog update-release-notes --draft --release
tools changelog update-release-notes --release
- name: Generate MAN Pages
shell: bash

View file

@ -111,8 +111,8 @@ on:
- name: Update Release Notes
shell: bash
run: |
tools changelog update-release-notes --draft
tools changelog update-release-notes
tools changelog update-release-notes --draft <%- if prepare_actual_release %> --release <%- endif %>
tools changelog update-release-notes <%- if prepare_actual_release %> --release <%- endif %>
- name: Generate MAN Pages
shell: bash

View file

@ -339,9 +339,14 @@ def update_deb(ctx: Context, salt_version: str, draft: bool = False):
"draft": {
"help": "Do not make any changes, instead output what would be changed.",
},
"release": {
"help": "Update for an actual release and not just a temporary CI build.",
},
},
)
def update_release_notes(ctx: Context, salt_version: str, draft: bool = False):
def update_release_notes(
ctx: Context, salt_version: str, draft: bool = False, release: bool = False
):
if salt_version is None:
salt_version = _get_salt_version(ctx)
if "+" in salt_version:
@ -362,6 +367,8 @@ def update_release_notes(ctx: Context, salt_version: str, draft: bool = False):
# Salt {salt_version} release notes - UNRELEASED
"""
)
if release is True:
existing = existing.replace(" - UNRELEASED", "")
with open(tmpnotes, "w") as wfp:
wfp.write(existing)
wfp.write("\n## Changelog\n")