From 6f56e297d9e5f0ec8ecafa710301a217bb6f5d21 Mon Sep 17 00:00:00 2001 From: Chisanan232 Date: Mon, 15 Jun 2026 08:24:56 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=90=9B=20(readme):=20Add=20GitHub=20r?= =?UTF-8?q?elease=20version=20badge=20next=20to=20PyPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Surfaces the published GitHub Release (v0.0.1-beta.1) alongside the existing PyPI badge (0.0.1b1) so the org profile + README reflect the coordinated release rather than the v0.0.2a1 source-of-truth tag. Refs AAASM-2956. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 049f1f59..ca54c83a 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![CI](https://img.shields.io/github/actions/workflow/status/ai-agent-assembly/python-sdk/ci.yaml?branch=master&logo=githubactions&logoColor=white&label=CI)](https://github.com/ai-agent-assembly/python-sdk/actions/workflows/ci.yaml) [![Docs](https://img.shields.io/github/actions/workflow/status/ai-agent-assembly/python-sdk/documentation.yaml?branch=master&logo=readthedocs&logoColor=white&label=docs)](https://github.com/ai-agent-assembly/python-sdk/actions/workflows/documentation.yaml) [![PyPI version](https://img.shields.io/pypi/v/agent-assembly?logo=pypi&logoColor=white)](https://pypi.org/project/agent-assembly/) +[![GitHub release](https://img.shields.io/github/v/release/ai-agent-assembly/python-sdk?include_prereleases&sort=semver&label=release&logo=github)](https://github.com/ai-agent-assembly/python-sdk/releases) [![Python versions](https://img.shields.io/pypi/pyversions/agent-assembly?logo=python&logoColor=white)](https://pypi.org/project/agent-assembly/) [![Coverage](https://img.shields.io/codecov/c/github/ai-agent-assembly/python-sdk?logo=codecov&logoColor=white)](https://codecov.io/gh/ai-agent-assembly/python-sdk) [![Quality Gate](https://img.shields.io/sonar/quality_gate/AI-agent-assembly_python-sdk?server=https%3A%2F%2Fsonarcloud.io&logo=sonarcloud)](https://sonarcloud.io/project/overview?id=AI-agent-assembly_python-sdk) From 0e40f722b719a75ddbbc0e0d9a8f83c5d266a9e8 Mon Sep 17 00:00:00 2001 From: Chisanan232 Date: Mon, 15 Jun 2026 08:25:34 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E2=9C=A8=20(release):=20Add=20pep440-to-ta?= =?UTF-8?q?g.sh=20reverse=20version=20converter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Inverse of tag-to-pep440.sh: maps a published PEP 440 version (e.g. 0.0.1b1) back to its canonical SemVer release tag (v0.0.1-beta.1) so release-python.yml can cut the SDK's own GitHub Release at the published version. Refs AAASM-2956. --- .github/scripts/pep440-to-tag.sh | 53 ++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100755 .github/scripts/pep440-to-tag.sh diff --git a/.github/scripts/pep440-to-tag.sh b/.github/scripts/pep440-to-tag.sh new file mode 100755 index 00000000..da21ccc0 --- /dev/null +++ b/.github/scripts/pep440-to-tag.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +# +# Convert a PEP 440 version string to the canonical SemVer release tag. +# Inverse of tag-to-pep440.sh — used by release-python.yml to cut the +# python-sdk's own GitHub Release at the published version. +# +# Examples: +# 0.0.1 -> v0.0.1 +# 0.0.1a8 -> v0.0.1-alpha.8 +# 0.0.1b2 -> v0.0.1-beta.2 +# 0.0.1rc3 -> v0.0.1-rc.3 +# +# Usage (CLI): +# .github/scripts/pep440-to-tag.sh 0.0.1b1 +# +# Usage (library — preferred from CI/workflows): +# source .github/scripts/pep440-to-tag.sh +# tag="$(pep440_to_tag "0.0.1b1")" +# +# This is the single source of truth for the reverse conversion. The +# release-python.yml `resolve` job sources this file so the workflow and +# the AAASM-2956 fixture suite exercise the exact same code path. +# +# Owner: python-sdk release pipeline (AAASM-2956). + +# Conversion function. Reads the PEP 440 version from $1 and prints the +# SemVer tag (with a leading `v`) to stdout. Returns non-zero only if the +# input is empty. `.post`/`.dev` suffixes are not valid SemVer pre-release +# identifiers in this scheme, so they are rejected — those are PyPI-only +# republish forms that do not correspond to a new GitHub Release tag. +pep440_to_tag() { + local version="${1-}" + if [[ -z "$version" ]]; then + echo "pep440_to_tag: missing version argument" >&2 + return 1 + fi + # Strip any leading `v` the caller may have passed by mistake. + local stripped="${version#v}" + # Expand the PEP 440 pre-release shorthand (a/b/rc) back to the + # hyphenated SemVer form. Anchored on the digits immediately following + # the marker so we never touch the base x.y.z component. + local tag + tag="$(printf '%s\n' "$stripped" | sed -E 's/a([0-9]+)$/-alpha.\1/; s/b([0-9]+)$/-beta.\1/; s/rc([0-9]+)$/-rc.\1/')" + printf 'v%s\n' "$tag" +} + +# When executed directly (not sourced), behave as a CLI: take the version +# as $1 and print the converted tag. When sourced, define the function +# only and let the caller drive it. +if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then + set -euo pipefail + pep440_to_tag "${1-}" +fi From c210202a7d1e67d57bf433344136babe7843a525 Mon Sep 17 00:00:00 2001 From: Chisanan232 Date: Mon, 15 Jun 2026 08:27:40 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E2=9C=85=20(release):=20Add=20fixture=20su?= =?UTF-8?q?ite=20for=20pep440-to-tag.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mirrors test_tag_to_pep440.sh: covers stable/alpha/beta/rc forms, the 0.0.1b1 -> v0.0.1-beta.1 backfill case, a tag<->pep440 roundtrip, and the empty-input guard. Refs AAASM-2956. --- .github/scripts/test_pep440_to_tag.sh | 101 ++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100755 .github/scripts/test_pep440_to_tag.sh diff --git a/.github/scripts/test_pep440_to_tag.sh b/.github/scripts/test_pep440_to_tag.sh new file mode 100755 index 00000000..5ebce0f2 --- /dev/null +++ b/.github/scripts/test_pep440_to_tag.sh @@ -0,0 +1,101 @@ +#!/usr/bin/env bash +# +# Unit tests for `.github/scripts/pep440-to-tag.sh`. +# +# Exercises the conversion function that release-python.yml's `resolve` +# job sources to turn a published PEP 440 version back into the canonical +# SemVer release tag the create-github-release job cuts. Because the +# workflow sources the same file, these tests cover the actual code path +# CI runs, not a copy of the regex. +# +# Run locally: +# bash .github/scripts/test_pep440_to_tag.sh +# +# Run from CI: see .github/workflows/release-python-conversion-test.yml. +# +# Exits 0 when every fixture passes, 1 otherwise. +# +# Refs AAASM-2956. + +set -uo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# shellcheck source=.github/scripts/pep440-to-tag.sh +source "${SCRIPT_DIR}/pep440-to-tag.sh" +# shellcheck source=.github/scripts/tag-to-pep440.sh +source "${SCRIPT_DIR}/tag-to-pep440.sh" + +pass=0 +fail=0 +total=0 + +# assert_eq