mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Generate next release notes when on master for nightly builds
This commit is contained in:
parent
532ba37206
commit
cbb8d86499
3 changed files with 33 additions and 4 deletions
9
.github/workflows/nightly.yml
vendored
9
.github/workflows/nightly.yml
vendored
|
@ -318,8 +318,13 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
|
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
|
||||||
run: |
|
run: |
|
||||||
tools changelog update-release-notes --draft
|
if [ "${{ contains(fromJSON('["master"]'), github.ref_name) }}" == "true" ]; then
|
||||||
tools changelog update-release-notes
|
tools changelog update-release-notes --draft --next-release
|
||||||
|
tools changelog update-release-notes --next-release
|
||||||
|
else
|
||||||
|
tools changelog update-release-notes --draft
|
||||||
|
tools changelog update-release-notes
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Generate MAN Pages
|
- name: Generate MAN Pages
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
10
.github/workflows/templates/ci.yml.jinja
vendored
10
.github/workflows/templates/ci.yml.jinja
vendored
|
@ -116,8 +116,18 @@ on:
|
||||||
shell: bash
|
shell: bash
|
||||||
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
|
if: ${{ startsWith(github.event.ref, 'refs/tags') == false }}
|
||||||
run: |
|
run: |
|
||||||
|
<%- if gh_environment == 'nightly' %>
|
||||||
|
if [ "${{ contains(fromJSON('["master"]'), github.ref_name) }}" == "true" ]; then
|
||||||
|
tools changelog update-release-notes --draft <%- if prepare_actual_release %> --release <%- endif %> --next-release
|
||||||
|
tools changelog update-release-notes <%- if prepare_actual_release %> --release <%- endif %> --next-release
|
||||||
|
else
|
||||||
|
tools changelog update-release-notes --draft <%- if prepare_actual_release %> --release <%- endif %>
|
||||||
|
tools changelog update-release-notes <%- if prepare_actual_release %> --release <%- endif %>
|
||||||
|
fi
|
||||||
|
<%- else %>
|
||||||
tools changelog update-release-notes --draft <%- if prepare_actual_release %> --release <%- endif %>
|
tools changelog update-release-notes --draft <%- if prepare_actual_release %> --release <%- endif %>
|
||||||
tools changelog update-release-notes <%- if prepare_actual_release %> --release <%- endif %>
|
tools changelog update-release-notes <%- if prepare_actual_release %> --release <%- endif %>
|
||||||
|
<%- endif %>
|
||||||
|
|
||||||
- name: Generate MAN Pages
|
- name: Generate MAN Pages
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
|
@ -15,6 +15,7 @@ import textwrap
|
||||||
from jinja2 import Environment, FileSystemLoader
|
from jinja2 import Environment, FileSystemLoader
|
||||||
from ptscripts import Context, command_group
|
from ptscripts import Context, command_group
|
||||||
|
|
||||||
|
import salt.version
|
||||||
from tools.utils import REPO_ROOT, Version
|
from tools.utils import REPO_ROOT, Version
|
||||||
|
|
||||||
CHANGELOG_LIKE_RE = re.compile(r"([\d]+)\.([a-z]+)$")
|
CHANGELOG_LIKE_RE = re.compile(r"([\d]+)\.([a-z]+)$")
|
||||||
|
@ -299,6 +300,9 @@ def update_deb(ctx: Context, salt_version: Version, draft: bool = False):
|
||||||
"template_only": {
|
"template_only": {
|
||||||
"help": "Only generate a template file.",
|
"help": "Only generate a template file.",
|
||||||
},
|
},
|
||||||
|
"next_release": {
|
||||||
|
"help": "Generate release notes for the next upcoming release.",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
def update_release_notes(
|
def update_release_notes(
|
||||||
|
@ -307,6 +311,7 @@ def update_release_notes(
|
||||||
draft: bool = False,
|
draft: bool = False,
|
||||||
release: bool = False,
|
release: bool = False,
|
||||||
template_only: bool = False,
|
template_only: bool = False,
|
||||||
|
next_release: bool = False,
|
||||||
):
|
):
|
||||||
if salt_version is None:
|
if salt_version is None:
|
||||||
salt_version = _get_salt_version(ctx)
|
salt_version = _get_salt_version(ctx)
|
||||||
|
@ -325,6 +330,15 @@ def update_release_notes(
|
||||||
release_notes_path = pathlib.Path("doc/topics/releases") / "{}.md".format(
|
release_notes_path = pathlib.Path("doc/topics/releases") / "{}.md".format(
|
||||||
version
|
version
|
||||||
)
|
)
|
||||||
|
if next_release and not release:
|
||||||
|
version = ".".join(
|
||||||
|
str(part)
|
||||||
|
for part in salt.version.SaltStackVersion(*version).next_release().info
|
||||||
|
)
|
||||||
|
release_notes_path = pathlib.Path("doc/topics/releases") / "{}.md".format(
|
||||||
|
version
|
||||||
|
)
|
||||||
|
|
||||||
template_release_path = (
|
template_release_path = (
|
||||||
release_notes_path.parent / "templates" / f"{version}.md.template"
|
release_notes_path.parent / "templates" / f"{version}.md.template"
|
||||||
)
|
)
|
||||||
|
@ -337,12 +351,12 @@ def update_release_notes(
|
||||||
{{{{ warning }}}}
|
{{{{ warning }}}}
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Add relase specific details below
|
Add release specific details below
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Do not edit the changelog below.
|
Do not edit the changelog below.
|
||||||
This is auto generated
|
This is auto generated.
|
||||||
-->
|
-->
|
||||||
## Changelog
|
## Changelog
|
||||||
{{{{ changelog }}}}
|
{{{{ changelog }}}}
|
||||||
|
|
Loading…
Add table
Reference in a new issue