Skip to content

Commit

Permalink
Append MCR images to end of release notes (#5595)
Browse files Browse the repository at this point in the history
  • Loading branch information
jumaffre authored Aug 29, 2023
1 parent 271750a commit a03d30a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
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

0 comments on commit a03d30a

Please sign in to comment.