diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bb29bb6..7aaff20 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -78,22 +78,75 @@ jobs: out.write(f"new_version={new_version}\n") PYEOF - # ── 2. Update CHANGELOG.md ──────────────────────────────────────────── + # ── 2. Update version badge in Hugo docs index ──────────────────────── + - name: Update version badge in Hugo docs + env: + NEW_VERSION: ${{ steps.bump.outputs.new_version }} + run: | + # Replace any existing version-X.Y.Z-blue badge with the new version + sed -i -E \ + "s|version-[0-9]+\.[0-9]+\.[0-9]+-blue|version-${NEW_VERSION}-blue|g" \ + hugo-docs/content/_index.md + + # ── 3. Update version badge in root README ──────────────────────────── + - name: Update version badge in root README + env: + NEW_VERSION: ${{ steps.bump.outputs.new_version }} + run: | + # Replace any existing version-X.Y.Z-blue badge with the new version + sed -i -E \ + "s|version-[0-9]+\.[0-9]+\.[0-9]+-blue|version-${NEW_VERSION}-blue|g" \ + README.md + + # ── 4. Update CHANGELOG.md from git diff ────────────────────────────── - name: Prepend CHANGELOG entry for new version env: NEW_VERSION: ${{ steps.bump.outputs.new_version }} run: | python - <<'PYEOF' import os + import subprocess from datetime import date new_version = os.environ["NEW_VERSION"] today = date.today().isoformat() + diff_output = subprocess.check_output( + ["git", "diff", "--name-status", "HEAD"], text=True + ).strip() + + changes = [] + for line in diff_output.splitlines(): + if not line.strip(): + continue + parts = line.split("\t", 1) + if len(parts) != 2: + continue + status, file_path = parts + if file_path == "CHANGELOG.md": + continue + status_label = { + "A": "Added", + "M": "Updated", + "D": "Removed", + "R": "Renamed", + "C": "Copied", + }.get(status[:1]) + if status_label is None: + print(f"WARNING: unknown git diff status '{status}' for '{file_path}', treating as Updated") + status_label = "Updated" + changes.append(f"- {status_label} `{file_path}`.") + + if not changes: + raise SystemExit( + "ERROR: no release file changes detected from git diff. " + "Check prior version-bump and badge-update steps." + ) + entry = ( f"\n## [{new_version}] - {today}\n\n" f"### Changed\n" - f"- Automated patch release — version bump to {new_version}.\n\n" + f"{'\n'.join(changes)}\n\n" f"---\n" ) @@ -115,26 +168,6 @@ jobs: print(f"CHANGELOG updated with {new_version} entry") PYEOF - # ── 3. Update version badge in Hugo docs index ──────────────────────── - - name: Update version badge in Hugo docs - env: - NEW_VERSION: ${{ steps.bump.outputs.new_version }} - run: | - # Replace any existing version-X.Y.Z-blue badge with the new version - sed -i -E \ - "s|version-[0-9]+\.[0-9]+\.[0-9]+-blue|version-${NEW_VERSION}-blue|g" \ - hugo-docs/content/_index.md - - # ── 4. Update version badge in root README ──────────────────────────── - - name: Update version badge in root README - env: - NEW_VERSION: ${{ steps.bump.outputs.new_version }} - run: | - # Replace any existing version-X.Y.Z-blue badge with the new version - sed -i -E \ - "s|version-[0-9]+\.[0-9]+\.[0-9]+-blue|version-${NEW_VERSION}-blue|g" \ - README.md - # ── 5. Open a PR with the version-bump changes ──────────────────────── # peter-evans/create-pull-request creates commits via the GitHub API so # they are automatically verified (signed), satisfying the branch diff --git a/CHANGELOG.md b/CHANGELOG.md index a5b56a6..c0fd5f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 --- +## [0.4.7] - 2026-07-08 + +### Changed +- Bumped CLI version to `0.4.7` in `cli/__version__.py`. +- Updated version badge to `0.4.7` in `README.md`. +- Updated version badge to `0.4.7` in `hugo-docs/content/_index.md`. + +--- + ## [0.4.6] - 2026-04-01 ### Changed diff --git a/README.md b/README.md index 3d90aec..96c967b 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![CI](https://github.com/cloudengine-labs/devops_os/actions/workflows/ci.yml/badge.svg)](https://github.com/cloudengine-labs/devops_os/actions/workflows/ci.yml) [![Sanity Tests](https://github.com/cloudengine-labs/devops_os/actions/workflows/sanity.yml/badge.svg)](https://github.com/cloudengine-labs/devops_os/actions/workflows/sanity.yml) -[![Version](https://img.shields.io/badge/version-0.4.6-blue)](CHANGELOG.md) +[![Version](https://img.shields.io/badge/version-0.4.7-blue)](CHANGELOG.md) [![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue?logo=python&logoColor=white)](https://www.python.org/) [![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE) [![Open Source](https://img.shields.io/badge/open%20source-%E2%9D%A4-red)](https://github.com/cloudengine-labs/devops_os) diff --git a/cli/__version__.py b/cli/__version__.py index 89f193d..5216500 100644 --- a/cli/__version__.py +++ b/cli/__version__.py @@ -1,3 +1,3 @@ """Single source of truth for the devopsos package version.""" -__version__ = "0.4.6" +__version__ = "0.4.7" diff --git a/hugo-docs/content/_index.md b/hugo-docs/content/_index.md index 76cbb1f..cc74f5f 100644 --- a/hugo-docs/content/_index.md +++ b/hugo-docs/content/_index.md @@ -9,7 +9,7 @@ type: "docs" [![CI](https://github.com/cloudengine-labs/devops_os/actions/workflows/ci.yml/badge.svg)](https://github.com/cloudengine-labs/devops_os/actions/workflows/ci.yml) [![Sanity Tests](https://github.com/cloudengine-labs/devops_os/actions/workflows/sanity.yml/badge.svg)](https://github.com/cloudengine-labs/devops_os/actions/workflows/sanity.yml) -[![Version](https://img.shields.io/badge/version-0.4.6-blue)](https://github.com/cloudengine-labs/devops_os/blob/main/CHANGELOG.md) +[![Version](https://img.shields.io/badge/version-0.4.7-blue)](https://github.com/cloudengine-labs/devops_os/blob/main/CHANGELOG.md) [![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue?logo=python&logoColor=white)](https://www.python.org/) [![License: MIT](https://img.shields.io/badge/license-MIT-green)](https://github.com/cloudengine-labs/devops_os/blob/main/LICENSE)