diff --git a/.github/workflows/seqera_docs_changelog.py b/.github/workflows/seqera_docs_changelog.py deleted file mode 100644 index f2d94f37a..000000000 --- a/.github/workflows/seqera_docs_changelog.py +++ /dev/null @@ -1,66 +0,0 @@ -import re -from pathlib import Path -import subprocess -from typing import TypedDict - - -class ChangelogData(TypedDict): - version: str - date: str - contents: str - - -def latest_version_data(changelog_content: str) -> ChangelogData: - lines = [] - for line in changelog_content.splitlines()[1:]: - if line.strip() == "": - break - lines.append(line) - - print(lines[0]) - match = re.match(r"^(.+) - (.+)$", lines[0]) - version, date = match.groups() - print(f"version: {version}, date: {date}") - contents = "\n".join(lines[1:]) - - return {"version": version, "date": date, "contents": contents} - - -# Read CHANGELOG.md -changelog_path = Path("changelog.txt") -if not changelog_path.exists(): - raise FileNotFoundError("changelog.txt not found") - -# Create seqeralabs-docs directory if it doesn't exist -docs_dir = Path("seqeralabs-docs") -# Clone seqeralabs-docs repo if it doesn't exist -if not docs_dir.exists(): - print("Cloning seqeralabs-docs repository...") - repo_url = "https://github.com/seqeralabs/docs.git" - try: - subprocess.run(["git", "clone", repo_url, str(docs_dir)], check=True) - except subprocess.CalledProcessError as e: - raise RuntimeError(f"Failed to clone repository: {e}") - -# Extract latest version -with open(changelog_path) as f: - changelog_data: ChangelogData = latest_version_data(f.read()) - -# Create output directory -output_dir = docs_dir / "changelog" / "wave" -output_dir.mkdir(parents=True, exist_ok=True) - -# Create output file -mdx_content: str = f"""--- -title: Wave v{changelog_data['version']} -date: {changelog_data['date']} -tags: [wave] ---- - -{changelog_data['contents']} -""" -with open(output_path := output_dir / f"v{changelog_data['version']}.mdx", "w") as f: - f.write(mdx_content) - -# Print version for GitHub Actions -print(f"::set-output name=version::{changelog_data['version']}")