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
106 changes: 102 additions & 4 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# .github/workflows/create-release.yml
name: Create GitHub Release

name: Create GitHub Release and Publish to PyPI
on:
push:
branches: [main] # Trigger on ANY push to main (including PR merges)
pull_request:
types: [closed] # Also trigger when PRs are merged
branches: [main]

jobs:
detect-and-release:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -82,7 +80,101 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}


# NEW: Set up Python for PyPI publishing
- name: Set up Python
if: steps.check-release.outputs.should_release == 'true'
uses: actions/setup-python@v5
with:
python-version: '3.11'

# NEW: Install build dependencies
- name: Install build dependencies
if: steps.check-release.outputs.should_release == 'true'
run: |
python -m pip install --upgrade pip
python -m pip install build twine

# NEW: Verify version matches tag
- name: Verify package version matches tag
if: steps.check-release.outputs.should_release == 'true'
run: |
TAG_VERSION="${{ steps.find-tags.outputs.version }}"

# Check if setup.py exists
if [ -f "setup.py" ]; then
PACKAGE_VERSION=$(python setup.py --version)
# Check if pyproject.toml exists
elif [ -f "pyproject.toml" ]; then
# Extract version from pyproject.toml
PACKAGE_VERSION=$(python -c "
import tomllib
with open('pyproject.toml', 'rb') as f:
data = tomllib.load(f)
print(data['project']['version'])
")
else
echo "❌ Neither setup.py nor pyproject.toml found!"
exit 1
fi

echo "Tag version: $TAG_VERSION"
echo "Package version: $PACKAGE_VERSION"

if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
echo "❌ Version mismatch! Tag: $TAG_VERSION, Package: $PACKAGE_VERSION"
exit 1
else
echo "✅ Version match confirmed: $TAG_VERSION"
fi

# NEW: Build Python package
- name: Build package
if: steps.check-release.outputs.should_release == 'true'
run: python -m build

# NEW: Check if package already exists on PyPI
- name: Check if package exists on PyPI
if: steps.check-release.outputs.should_release == 'true'
id: check-pypi
run: |
VERSION="${{ steps.find-tags.outputs.version }}"

# Get package name from setup.py or pyproject.toml
if [ -f "pyproject.toml" ]; then
PACKAGE_NAME=$(python -c "
import tomllib
with open('pyproject.toml', 'rb') as f:
data = tomllib.load(f)
print(data['project']['name'])
")
elif [ -f "setup.py" ]; then
PACKAGE_NAME=$(python setup.py --name)
else
echo "❌ Cannot determine package name"
exit 1
fi

echo "Checking if $PACKAGE_NAME version $VERSION exists on PyPI..."

# Check if this version already exists on PyPI
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "https://pypi.org/pypi/$PACKAGE_NAME/$VERSION/json/")

if [ "$HTTP_CODE" = "200" ]; then
echo "⚠️ Package $PACKAGE_NAME v$VERSION already exists on PyPI, skipping upload"
echo "should_publish_pypi=false" >> $GITHUB_OUTPUT
else
echo "✅ Package $PACKAGE_NAME v$VERSION not found on PyPI, proceeding with upload"
echo "should_publish_pypi=true" >> $GITHUB_OUTPUT
fi

# NEW: Publish to PyPI using API token
- name: Publish package to PyPI
if: steps.check-release.outputs.should_release == 'true' && steps.check-pypi.outputs.should_publish_pypi == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
print-hash: true

- name: Create main GitHub Release
if: steps.check-release.outputs.should_release == 'true'
uses: softprops/action-gh-release@v1
Expand All @@ -100,6 +192,12 @@ jobs:

This release synchronizes all RunAgent SDKs (Python, JavaScript, Rust, Go) to version ${{ steps.find-tags.outputs.version }}.

## 📦 Installation

```bash
pip install runagent==${{ steps.find-tags.outputs.version }}
```

draft: false
prerelease: false
generate_release_notes: true # Let GitHub add commit-based notes
Expand Down
10 changes: 3 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# Changelog
All notable changes to this project's latest version.

## [0.1.18] - 2025-07-29
## [0.1.20] - 2025-08-27

### Bug Fixes

- Fixed relase yml

### Features

- Realease action workflow fixed
- Workflow cliff install fixed ([#46](https://github.com/your-org/your-repo/issues/46))

### Miscellaneous Tasks

- Bump version to v0.1.18
- Bump version to v0.1.19

<!-- generated by git-cliff -->
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "hatchling.build"

[project]
name = "runagent"
version = "0.1.19"
version = "0.1.20"
description = "A command-line tool and SDK for deploying, managing, and interacting with AI agents"
readme = "README.md"
requires-python = ">=3.9"
Expand Down Expand Up @@ -103,7 +103,7 @@ line_length = 88
skip = ["docs"]

[tool.mypy]
python_version = "0.1.19"
python_version = "0.1.20"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
Expand Down Expand Up @@ -159,7 +159,7 @@ fail_under = 80

[tool.ruff]
line-length = 88
target-version = "0.1.19"
target-version = "0.1.20"
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
Expand Down
72 changes: 11 additions & 61 deletions release.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ update_python_version() {
local version=$1
local pyproject_file="pyproject.toml"
local version_file="runagent/__version__.py"
local init_file="runagent/__init__.py"
local success=false

# Update pyproject.toml
Expand Down Expand Up @@ -132,6 +133,15 @@ update_python_version() {
echo "__version__ = \"$version\"" > "$version_file"
fi

# Also update __init__.py version
if [[ -f "$init_file" ]]; then
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "s/__version__ = \".*\"/__version__ = \"$version\"/" "$init_file"
else
sed -i "s/__version__ = \".*\"/__version__ = \"$version\"/" "$init_file"
fi
fi

if verify_version_update "$version_file" "$version" "__version__ = \"$version\""; then
success=true
fi
Expand Down Expand Up @@ -222,57 +232,10 @@ EOF
}

generate_changelog() {
# local version=$1
# local tag_name="v$version"

# echo "📝 Generating changelog with git-cliff..."

# # Find the previous tag to determine range
# local last_tag
# last_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "")

# if [[ -n "$last_tag" ]]; then
# echo "📍 Generating changelog for range: $last_tag → $tag_name"

# # Generate changelog for the current version using --latest if we're at the latest
# # Or specify the tag explicitly for historical generation
# if [[ -f "cliff.toml" ]]; then
# First try to generate for the specific tag
# git-cliff --tag "$tag_name" --latest --strip header --strip footer > "CHANGELOG_NEW.md" 2>/dev/null || {
# echo "⚠️ git-cliff --latest failed, trying full tag generation"
# git-cliff --tag "$tag_name" --strip header --strip footer > "CHANGELOG_NEW.md" 2>/dev/null || {
# echo "⚠️ git-cliff failed, creating basic changelog"
# create_basic_changelog "$version" "$last_tag"
# return
# }
# }
# else
# git-cliff --tag "$tag_name" --latest --strip header --strip footer > "CHANGELOG_NEW.md" 2>/dev/null || {
# echo "⚠️ git-cliff failed, creating basic changelog"
# create_basic_changelog "$version" "$last_tag"
# return
# }
# fi
# else
# echo "📍 No previous tags found - generating changelog for initial release"
# create_initial_changelog "$version"
# return
# fi

# Check if we got meaningful output
# if [[ ! -s "CHANGELOG_NEW.md" ]] || [[ $(wc -l < "CHANGELOG_NEW.md") -lt 2 ]]; then
# echo "⚠️ git-cliff produced minimal output, creating basic changelog"
# create_basic_changelog "$version" "$last_tag"
# return
# fi
git-cliff --output CHANGELOG.md --latest
# Update main CHANGELOG.md
# update_main_changelog "$version"

echo "✅ Changelog generated successfully"
}


show_update_summary() {
echo ""
echo "📋 Update Summary:"
Expand Down Expand Up @@ -317,7 +280,6 @@ check_prerequisites() {
echo "❌ Error: Not in a git repository or git is not working"
exit 1
fi

}

handle_existing_tag() {
Expand Down Expand Up @@ -372,7 +334,6 @@ check_git_cliff

check_prerequisites


# Update all package files
update_python_version "$VERSION"
update_javascript_version "$VERSION"
Expand All @@ -389,16 +350,9 @@ fi

if [[ "$any_success" == "false" ]]; then
echo "❌ No version updates succeeded. Aborting release."
# # Restore backup
# if [[ -f "CHANGELOG.md.bak" ]]; then
# mv "CHANGELOG.md.bak" "CHANGELOG.md"
# fi
exit 1
fi

# Generate changelog
# generate_changelog "$VERSION"

# Show git changes
if ! git diff --name-only --quiet 2>/dev/null; then
echo "Changes detected:"
Expand All @@ -413,19 +367,16 @@ echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Release cancelled."
git checkout -- . 2>/dev/null || true

exit 0
fi


# Handle existing tag
if handle_existing_tag "$VERSION"; then
echo "✅ Tag v$VERSION updated successfully!"
generate_changelog
exit 0
fi


# Stage and commit changes
git add .

Expand All @@ -434,7 +385,7 @@ if git diff --staged --quiet; then
exit 1
fi

# # Create new tag
# Create new tag
git tag -a "v$VERSION" -m "Release v$VERSION
RunAgent Universal Release v$VERSION"

Expand All @@ -443,7 +394,6 @@ echo "✅ Tag v$VERSION created and pushed successfully!"

generate_changelog


git commit -m "chore: bump version to v$VERSION

- Updated all SDK versions to $VERSION
Expand Down
2 changes: 1 addition & 1 deletion runagent-go/runagent/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package runagent

// Version represents the current version of the RunAgent Go SDK
const Version = "0.1.19"
const Version = "0.1.20"
2 changes: 1 addition & 1 deletion runagent-rust/runagent/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "runagent"
version = "0.1.19"
version = "0.1.20"
edition = "2021"
description = "RunAgent SDK for Rust - Deploy and manage AI agents easily"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion runagent-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "runagent",
"version": "0.1.19",
"version": "0.1.20",
"type": "module",
"files": [
"dist"
Expand Down
2 changes: 1 addition & 1 deletion runagent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
built with frameworks like LangGraph, LangChain, and LlamaIndex.
"""

__version__ = "0.1.0"
__version__ = "0.1.20"

from .client import RunAgentClient

Expand Down
2 changes: 1 addition & 1 deletion runagent/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.19"
__version__ = "0.1.20"
20 changes: 20 additions & 0 deletions runagent/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,26 @@
console = Console()


def print_version(ctx, param, value):
"""Custom version callback with colored output"""
if not value or ctx.resilient_parsing:
return
try:
from runagent.__version__ import __version__
console.print(f"[bold cyan]runagent {__version__}[/bold cyan]")
except ImportError:
console.print("[red]runagent version unknown[/red]")
ctx.exit()


@click.command()
def version():
"""Show version information"""
try:
from runagent.__version__ import __version__
console.print(f"[bold cyan]runagent {__version__}[/bold cyan]")
except ImportError:
console.print("[red]runagent version unknown[/red]")

@click.command()
@click.option("--api-key", required=True, help="Your API key")
Expand Down
Loading
Loading