Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Append MCR images to end of release notes #5595

Merged
merged 3 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .azure-pipelines-templates/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

- script: |
set -ex
python3.8 ./scripts/extract-release-notes.py --target-git-version | tee $(Build.BinariesDirectory)/rel-notes.md
python3.8 ./scripts/extract-release-notes.py --target-git-version --append-mcr-images | tee $(Build.BinariesDirectory)/rel-notes.md
displayName: Extract release notes

- script: |
Expand Down
25 changes: 25 additions & 0 deletions scripts/extract-release-notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
import sys
import subprocess

MICROSOFT_ARTIFACT_REGISTRY_NAME = "mcr.microsoft.com"
MICROSOFT_ARTIFACT_REGISTRY_PREFIX = "product"
CCF_APP_IMAGE_PREFIX = "ccf/app"
CCF_MCR_IMAGES = {
"App Development": f"{CCF_APP_IMAGE_PREFIX}/dev",
"C++ Runtime": f"{CCF_APP_IMAGE_PREFIX}/run",
"TypeScript/JavaScript Runtime": f"{CCF_APP_IMAGE_PREFIX}/run-js",
}


def main():
parser = argparse.ArgumentParser(
Expand All @@ -32,6 +41,12 @@ def main():
help="Fix any automatically correctable errors",
action="store_true",
)
parser.add_argument(
"--append-mcr-images",
help="If true, automatically append MCR images URLs to release notes",
action="store_true",
default=False,
)
args = parser.parse_args()

if args.target_git_version:
Expand Down Expand Up @@ -100,6 +115,16 @@ def main():
print("\n" + "-" * 80 + "\n")
print(f"# {version}")
print("\n".join(release_notes[version]).strip())
if args.append_mcr_images:
print("\n**MCR Docker Images:** ", end="")
print(
", ".join(
[
f"[{desc}](https://{MICROSOFT_ARTIFACT_REGISTRY_NAME}/{MICROSOFT_ARTIFACT_REGISTRY_PREFIX}/{name}/tags)"
for desc, name in CCF_MCR_IMAGES.items()
]
)
)
else:
print("CHANGELOG is valid!")

Expand Down