wasm-micro-runtime/.github/scripts/extract_from_release_notes.py
Wenyong Huang 84161fe084
Add CIs to release new version and publish binary files (#1648)
Add CIs to enable the release process of a new version of WAMR,
and build and publish the binary files when a version is released,
including iwasm, wamrc, lldb, vscode-extension and wamr-ide for
Ubuntu-20.04, Ubuntu-22.04 and MacOS.

And refine the CIs to test spec cases.
2022-10-28 13:55:41 +08:00

61 lines
1.2 KiB
Python

#!/usr/bin/env python3
#
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
"""
Extract the latest release notes content from RELEASE_NOTES.md
"""
import argparse
import os
import sys
import traceback
def latest_content(release_notes_path):
"""
can't change the format of the original content
"""
content = ""
start_extract = False
with open(release_notes_path, encoding="utf-8") as f:
for line in f:
if line.startswith("## "):
if start_extract:
break
start_extract = True
continue
# hit a separated line
if line.startswith("---"):
break
content += line
content += os.linesep
return content
def main():
"""
GO!GO!!GO!!!
"""
parser = argparse.ArgumentParser(description="run the sample and examine outputs")
parser.add_argument("release_notes_path", type=str)
args = parser.parse_args()
ret = 1
try:
print(latest_content(args.release_notes_path))
ret = 0
except AssertionError:
traceback.print_exc()
return ret
if __name__ == "__main__":
sys.exit(main())