Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/a2aprotocol/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "microsoft-teams-a2a"
version = "2.0.0a4"
version = "2.0.0a5"
description = "plugin that enables your teams agent to be used as an a2a agent"
authors = [{ name = "Microsoft", email = "TeamsAISDKFeedback@microsoft.com" }]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion packages/ai/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "microsoft-teams-ai"
version = "2.0.0a4"
version = "2.0.0a5"
description = "package to handle interacting with ai or llms"
authors = [{ name = "Microsoft", email = "TeamsAISDKFeedback@microsoft.com" }]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion packages/api/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "microsoft-teams-api"
version = "2.0.0a4"
version = "2.0.0a5"
description = "API package for Microsoft Teams"
readme = "README.md"
repository = "https://github.com/microsoft/teams.py"
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "microsoft-teams-apps"
version = "2.0.0a4"
version = "2.0.0a5"
description = "The app package for a Microsoft Teams agent"
authors = [{ name = "Microsoft", email = "TeamsAISDKFeedback@microsoft.com" }]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion packages/cards/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "microsoft-teams-cards"
version = "2.0.0a4"
version = "2.0.0a5"
description = "Cards package for Microsoft Teams"
readme = "README.md"
repository = "https://github.com/microsoft/teams.py"
Expand Down
2 changes: 1 addition & 1 deletion packages/common/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "microsoft-teams-common"
version = "2.0.0a4"
version = "2.0.0a5"
description = "Common package for Microsoft Teams"
readme = "README.md"
repository = "https://github.com/microsoft/teams.py"
Expand Down
2 changes: 1 addition & 1 deletion packages/devtools/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "microsoft-teams-devtools"
version = "2.0.0a4"
version = "2.0.0a5"
description = "Local tool to streamline testing and development"
authors = [{ name = "Microsoft", email = "TeamsAISDKFeedback@microsoft.com" }]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion packages/graph/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "microsoft-teams-graph"
version = "2.0.0a4"
version = "2.0.0a5"
description = "The Graph package for a Microsoft Teams agent"
readme = "README.md"
license = { text = "MIT" }
Expand Down
2 changes: 1 addition & 1 deletion packages/mcpplugin/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "microsoft-teams-mcpplugin"
version = "2.0.0a4"
version = "2.0.0a5"
description = "library for handling mcp with teams sdk"
authors = [{ name = "Microsoft", email = "TeamsAISDKFeedback@microsoft.com" }]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion packages/openai/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "microsoft-teams-openai"
version = "2.0.0a4"
version = "2.0.0a5"
description = "model package for enabling chat experiences with openai"
authors = [{ name = "Microsoft", email = "TeamsAISDKFeedback@microsoft.com" }]
readme = "README.md"
Expand Down
116 changes: 116 additions & 0 deletions scripts/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

import tomllib

# ANSI color codes
GREEN = "\033[92m"
RESET = "\033[0m"


def get_packages_dir() -> Path:
"""Get the packages directory relative to the script location."""
Expand Down Expand Up @@ -107,6 +111,38 @@ def get_package_version(package_path: Path) -> str:
sys.exit(1)


def get_last_tag() -> str:
"""Get the last git tag matching v* pattern."""
try:
result = subprocess.run(
["git", "describe", "--tags", "--abbrev=0", "--match", "v*"],
capture_output=True,
text=True,
check=True,
)
return result.stdout.strip()
except subprocess.CalledProcessError:
print("Warning: No previous tags found matching 'v*' pattern")
return ""


def get_commits_since_tag(tag: str) -> List[str]:
"""Get commit messages from current HEAD to the specified tag."""
try:
# Get commit messages in format: "- <commit message>"
result = subprocess.run(
["git", "log", f"{tag}..HEAD", "--pretty=format:- %s"],
capture_output=True,
text=True,
check=True,
)
commits = result.stdout.strip().split("\n")
return [c for c in commits if c] # Filter empty strings
except subprocess.CalledProcessError as e:
print(f"Error getting commits: {e}")
return []


def create_release_branch(version: str, verbose: bool = False) -> str:
"""Create a new release branch."""
branch_name = f"release_{version}"
Expand All @@ -129,6 +165,51 @@ def create_release_branch(version: str, verbose: bool = False) -> str:
sys.exit(1)


def create_pull_request(version: str, commits: List[str], verbose: bool = False) -> None:
"""Create a pull request for the release."""
try:
# Push the branch to remote
branch_name = f"release_{version}"
subprocess.run(
["git", "push", "-u", "origin", branch_name],
check=True,
capture_output=not verbose,
)
print(f"Pushed branch {branch_name} to remote")

# Create PR body with commits
pr_body = f"## Release {version}\n\n### Changes\n\n"
if commits:
pr_body += "\n".join(commits)
else:
pr_body += "No commits since last tag"

# Create PR using gh CLI
result = subprocess.run(
[
"gh",
"pr",
"create",
"--title",
f"Release {version}",
"--body",
pr_body,
"--base",
"main",
],
capture_output=True,
text=True,
check=True,
)
print("✓ Pull request created successfully")
print(result.stdout.strip())
except subprocess.CalledProcessError as e:
print(f"Error creating pull request: {e}")
if e.stderr:
print(f" {e.stderr}")
sys.exit(1)


def main() -> None:
"""Main script entry point."""
parser = argparse.ArgumentParser(
Expand Down Expand Up @@ -182,6 +263,22 @@ def main() -> None:
print(f" - {pkg.name}")
print()

# Get commits since last tag for PR description (show regardless of PR creation)
last_tag = get_last_tag()
commits_since_tag: List[str] = []
if last_tag:
print(f"Last tag: {last_tag}")
commits_since_tag = get_commits_since_tag(last_tag)
if commits_since_tag:
print(f"\nCommits since {last_tag}:")
for commit in commits_since_tag:
print(f" {GREEN}{commit}{RESET}")
print()
else:
print(f"No commits since {last_tag}\n")
else:
print("No previous tags found\n")

# First, do a dry-run to check all packages would have the same version
print("Running dry-run to check version consistency...")
dry_run_versions: Dict[str, str] = {}
Expand Down Expand Up @@ -228,9 +325,28 @@ def main() -> None:
branch_name = create_release_branch(release_version, args.verbose)
print(f"\n✓ Release {release_version} is ready!")
print(f" Branch: {branch_name}")

# Ask user about creating PR
pr_response = input("\nWould you like to create a pull request (y/N): ").strip().lower()
if pr_response in ("y", "yes"):
create_pull_request(release_version, commits_since_tag, args.verbose)
else:
print("\nYou can manually create a PR when ready using:")
print(f" git push -u origin {branch_name}")
print(f" gh pr create --title 'Release {release_version}' --base main")
# Show commits again for easy copy-paste
if commits_since_tag:
print("\nCommits to include in PR description:")
for commit in commits_since_tag:
print(f" {GREEN}{commit}{RESET}")
else:
print(f"\nVersion bump complete. Release version: {release_version}")
print("You can manually commit and create a branch/PR when ready.")
# Show commits for reference even if no branch was created
if commits_since_tag:
print("\nCommits since last tag:")
for commit in commits_since_tag:
print(f" {GREEN}{commit}{RESET}")


if __name__ == "__main__":
Expand Down
Loading