diff --git a/plugin-template b/plugin-template index da4342fd..3d7343b3 100755 --- a/plugin-template +++ b/plugin-template @@ -347,6 +347,7 @@ def main(): if "github" in sections: migrate_pytest_plugins(plugin_root_dir) + append_releasing_to_manifest(plugin_root_dir) if plugin_root_dir: print("\nDeprecation check:") @@ -379,6 +380,14 @@ def migrate_pytest_plugins(plugin_root_dir): fp.writelines(lines) +def append_releasing_to_manifest(plugin_root): + manifest_file = Path(plugin_root) / "MANIFEST.in" + if manifest_file.exists(): + manifest_text = manifest_file.read_text() + if "exclude releasing.md" not in manifest_text: + manifest_file.write_text(manifest_text + "exclude releasing.md\n") + + def to_nice_yaml(data): """Implement a filter for Jinja 2 templates to render human readable YAML.""" return yaml.dump(data, indent=2, allow_unicode=True, default_flow_style=False) diff --git a/templates/bootstrap/MANIFEST.in b/templates/bootstrap/MANIFEST.in index d9752938..6b553768 100644 --- a/templates/bootstrap/MANIFEST.in +++ b/templates/bootstrap/MANIFEST.in @@ -6,3 +6,4 @@ include LICENSE include pyproject.toml include requirements.txt include unittest_requirements.txt +exclude releasing.md diff --git a/templates/github/releasing.md.j2 b/templates/github/releasing.md.j2 new file mode 100644 index 00000000..ca8471a6 --- /dev/null +++ b/templates/github/releasing.md.j2 @@ -0,0 +1,22 @@ +{% include 'header.md.j2' %} +# Releasing (For Internal Use) + +This document outlines the steps to perform a release. + +### Determine if a Release is Required +- Run the release checker script: + ``` + python3 .ci/scripts/check_release.py + ``` + +### Create a New Y-branch (e.g., 3.23) +- If a new minor version (Y) is needed, trigger a [Create New Release Branch](https://github.com/pulp/{{ plugin_name }}/actions/workflows/create-branch.yml) job via the GitHub Actions. +- Look for the "Bump minor version" pull request and merge it. + +### Release a New Z-version (Patch Release) (e.g., 3.23.1, 3.22.12) +- Trigger a [Release Pipeline](https://github.com/pulp/{{ plugin_name }}/actions/workflows/release.yml) job by specifying the release branch (X.Y) via the GitHub Actions. + +### Final Steps (Optional but Recommended) +- Ensure the new version appears on PyPI. +- Verify that the changelog has been updated by looking for the "Update Changelog" pull request. +- Post a brief announcement about the new release on the [Pulp Discourse](https://discourse.pulpproject.org/). diff --git a/templates/header.md.j2 b/templates/header.md.j2 new file mode 100644 index 00000000..7dc41a88 --- /dev/null +++ b/templates/header.md.j2 @@ -0,0 +1,6 @@ +[//]: # "WARNING: DO NOT EDIT!" +[//]: # "" +[//]: # "This file was generated by plugin_template, and is managed by it. Please use" +[//]: # "'./plugin-template --{{ section }} {{ plugin_name | snake }}' to update this file." +[//]: # "" +[//]: # "For more info visit https://github.com/pulp/plugin_template"