diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 25db786..ec7e2e4 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -154,6 +154,50 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + + - name: Extract changelog for version + id: extract-changelog + run: | + VERSION="${{ needs.detect-release.outputs.version }}" + TAG="${{ needs.detect-release.outputs.latest_tag }}" + + # Function to extract changelog section + extract_section() { + local pattern="$1" + # Extract from the pattern to the next ## or end of file + awk -v pattern="$pattern" ' + /^## \[/ { + if (found) exit + if ($0 ~ pattern) { found=1; next } + } + found { print } + ' CHANGELOG.md | sed '/^/d' + } + + # Try to find the changelog section + CHANGELOG_CONTENT="" + + if grep -q "## \[$VERSION\]" CHANGELOG.md; then + CHANGELOG_CONTENT=$(extract_section "\\[$VERSION\\]") + elif grep -q "## \[$TAG\]" CHANGELOG.md; then + CHANGELOG_CONTENT=$(extract_section "\\[$TAG\\]") + else + # Fallback: get the first version section (usually the latest) + CHANGELOG_CONTENT=$(awk '/^## \[/,/^## \[|^$/' CHANGELOG.md | tail -n +2 | head -n -1 | sed '/^/d') + fi + + # If still empty, provide a default message + if [ -z "$CHANGELOG_CONTENT" ]; then + CHANGELOG_CONTENT="No changelog entries found for this version." + fi + + # Output using multiline format for GitHub Actions + { + echo 'changelog<> "$GITHUB_OUTPUT" + - name: Create main GitHub Release uses: softprops/action-gh-release@v1 with: @@ -166,9 +210,7 @@ jobs: ## 📋 What's New - For detailed changes in this release, see [CHANGELOG.md](./CHANGELOG.md). - - This release synchronizes all RunAgent SDKs (Python, JavaScript, Rust, Go) to version ${{ needs.detect-release.outputs.version }}. + ${{ steps.extract-changelog.outputs.changelog }} ## 📦 Installation @@ -176,9 +218,25 @@ jobs: pip install runagent==${{ needs.detect-release.outputs.version }} ``` + ```bash + npm install @runagent/sdk@${{ needs.detect-release.outputs.version }} + ``` + + ```bash + cargo add runagent@${{ needs.detect-release.outputs.version }} + ``` + + ```bash + go get github.com/runagent-dev/runagent-go@${{ needs.detect-release.outputs.latest_tag }} + ``` + + --- + + For the full changelog, see [CHANGELOG.md](./CHANGELOG.md). + draft: false prerelease: false - generate_release_notes: true # Let GitHub add commit-based notes + generate_release_notes: false files: | CHANGELOG.md env: diff --git a/release.sh b/release.sh index e9a75ad..3cc8916 100755 --- a/release.sh +++ b/release.sh @@ -370,16 +370,13 @@ if [[ ! $REPLY =~ ^[Yy]$ ]]; then exit 0 fi -# Generate changelog BEFORE creating tag -generate_changelog - -# Handle existing tag +# Handle existing tag FIRST (before generating changelog) if handle_existing_tag "$VERSION"; then echo "✅ Tag v$VERSION updated successfully!" exit 0 fi -# Stage and commit changes (including changelog) +# Stage and commit version changes FIRST (without changelog) git add . if git diff --staged --quiet; then @@ -387,18 +384,26 @@ if git diff --staged --quiet; then exit 1 fi -# Commit changes first +# Commit version changes first git commit -m "chore: bump version to v$VERSION -- Updated all SDK versions to $VERSION -- Generated changelog with git-cliff" -q +- Updated all SDK versions to $VERSION" -q -# Create new tag +# Create tag BEFORE generating changelog (so git-cliff knows about it) git tag -a "v$VERSION" -m "Release v$VERSION RunAgent Universal Release v$VERSION All SDKs updated to version $VERSION" +# NOW generate changelog (tag exists, so git-cliff can reference it properly) +generate_changelog + +# Stage and commit changelog separately +git add CHANGELOG.md +if ! git diff --staged --quiet; then + git commit -m "docs: update changelog for v$VERSION" -q +fi + CURRENT_BRANCH=$(git branch --show-current 2>/dev/null || git rev-parse --abbrev-ref HEAD 2>/dev/null) # Push commit first, then tag (to prevent orphaned tags) diff --git a/runagent-go/PUBLISH.md b/runagent-go/PUBLISH.md index 912dee0..cc4de02 100644 --- a/runagent-go/PUBLISH.md +++ b/runagent-go/PUBLISH.md @@ -1,6 +1,6 @@ ## Publishing `runagent-go` -The Go SDK is distributed through this monorepo using Go modules. Releasing a new version requires tagging the repository so `go get github.com/runagent-dev/runagent/runagent-go/runagent@vX.Y.Z` resolves to the new code. +The Go SDK is distributed through this repository using Go modules. Releasing a new version requires tagging the repository so `go get github.com/runagent-dev/runagent-go@vX.Y.Z` resolves to the new code. --- @@ -15,7 +15,7 @@ The Go SDK is distributed through this monorepo using Go modules. Releasing a ne ### 2. Preflight Checklist 1. **Bump the SDK version** - - Update `runagent/runagent-go/runagent/version.go`. + - Update `version.go` in the root directory. - Follow semver (increment patch for fixes, minor for new features, major for breaking changes). 2. **Changelog / release notes** - Update the main repo changelog or docs to record the release. @@ -29,8 +29,8 @@ The Go SDK is distributed through this monorepo using Go modules. Releasing a ne ```bash # From runagent-go/ -go test ./runagent/... -golangci-lint run ./runagent/... # optional but recommended +go test ./... +golangci-lint run ./... # optional but recommended ``` For extra assurance, run the example binaries: @@ -45,13 +45,13 @@ go run ./examples/streaming.go ### 4. Commit & Tag ```bash -git add runagent-go +git add . git commit -m "chore(go): release v0.1.34" -# Tag with the `sdk-go-` prefix so automation can detect it -git tag sdk-go-v0.1.34 +# Tag with version prefix +git tag v0.1.34 git push origin main -git push origin sdk-go-v0.1.34 +git push origin v0.1.34 ``` > If releasing from a feature branch, merge it first (or push the tag from the release branch) so `main` reflects the published state. @@ -62,7 +62,7 @@ git push origin sdk-go-v0.1.34 - Announce the release internally and update documentation links (docs site, README tables, etc.). - Monitor `go proxy` and `pkg.go.dev` (usually available within minutes after pushing the tag). -- Verify `go list -m github.com/runagent-dev/runagent/runagent-go/runagent@latest` resolves to the new version. +- Verify `go list -m github.com/runagent-dev/runagent-go@latest` resolves to the new version. --- diff --git a/runagent-go/README.md b/runagent-go/README.md index 0db82b8..e501d04 100644 --- a/runagent-go/README.md +++ b/runagent-go/README.md @@ -35,7 +35,7 @@ The Go SDK mirrors the Python CLI client so Go services can trigger hosted or lo ### Installation ```bash -go get github.com/runagent-dev/runagent/runagent-go/runagent +go get github.com/runagent-dev/runagent-go ``` Requires Go 1.21+. @@ -101,7 +101,7 @@ import ( "time" "os" - "github.com/runagent-dev/runagent/runagent-go/runagent" + "github.com/runagent-dev/runagent-go" ) func main() { diff --git a/runagent-go/basic b/runagent-go/basic new file mode 100755 index 0000000..3d0d63e Binary files /dev/null and b/runagent-go/basic differ diff --git a/runagent-go/runagent/client.go b/runagent-go/client.go similarity index 99% rename from runagent-go/runagent/client.go rename to runagent-go/client.go index f7dc99b..0d038d7 100644 --- a/runagent-go/runagent/client.go +++ b/runagent-go/client.go @@ -16,8 +16,8 @@ import ( "github.com/gorilla/websocket" - "github.com/runagent-dev/runagent/runagent-go/runagent/pkg/constants" - "github.com/runagent-dev/runagent/runagent-go/runagent/pkg/db" + "github.com/runagent-dev/runagent-go/internal/constants" + "github.com/runagent-dev/runagent-go/internal/db" ) // RunAgentClient is the main entry point for invoking RunAgent deployments. diff --git a/runagent-go/runagent/errors.go b/runagent-go/errors.go similarity index 100% rename from runagent-go/runagent/errors.go rename to runagent-go/errors.go diff --git a/runagent-go/examples/basic.go b/runagent-go/examples/basic.go index 1ca5b31..92429de 100644 --- a/runagent-go/examples/basic.go +++ b/runagent-go/examples/basic.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/runagent-dev/runagent/runagent-go/runagent" + "github.com/runagent-dev/runagent-go" ) func main() { diff --git a/runagent-go/examples/streaming.go b/runagent-go/examples/streaming.go index 47e58dd..92f99d5 100644 --- a/runagent-go/examples/streaming.go +++ b/runagent-go/examples/streaming.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/runagent-dev/runagent/runagent-go/runagent" + "github.com/runagent-dev/runagent-go" ) func main() { diff --git a/runagent-go/go.mod b/runagent-go/go.mod index dd9693c..cff1943 100644 --- a/runagent-go/go.mod +++ b/runagent-go/go.mod @@ -1,4 +1,4 @@ -module github.com/runagent-dev/runagent/runagent-go +module github.com/runagent-dev/runagent-go go 1.23.4 diff --git a/runagent-go/runagent/pkg/client/client.go b/runagent-go/internal/client/client.go similarity index 98% rename from runagent-go/runagent/pkg/client/client.go rename to runagent-go/internal/client/client.go index 7c20518..232261d 100644 --- a/runagent-go/runagent/pkg/client/client.go +++ b/runagent-go/internal/client/client.go @@ -12,9 +12,9 @@ import ( "time" "github.com/gorilla/websocket" - "github.com/runagent-dev/runagent/runagent-go/runagent/pkg/config" - "github.com/runagent-dev/runagent/runagent-go/runagent/pkg/db" - "github.com/runagent-dev/runagent/runagent-go/runagent/pkg/types" + "github.com/runagent-dev/runagent-go/internal/config" + "github.com/runagent-dev/runagent-go/internal/db" + "github.com/runagent-dev/runagent-go/internal/types" ) // WebSocketMessage represents a WebSocket message diff --git a/runagent-go/runagent/pkg/config/config.go b/runagent-go/internal/config/config.go similarity index 98% rename from runagent-go/runagent/pkg/config/config.go rename to runagent-go/internal/config/config.go index 0091389..67af272 100644 --- a/runagent-go/runagent/pkg/config/config.go +++ b/runagent-go/internal/config/config.go @@ -7,7 +7,7 @@ import ( "path/filepath" "strings" - "github.com/runagent-dev/runagent/runagent-go/runagent/pkg/constants" + "github.com/runagent-dev/runagent-go/internal/constants" ) // Config holds the SDK configuration diff --git a/runagent-go/runagent/pkg/constants/constants.go b/runagent-go/internal/constants/constants.go similarity index 100% rename from runagent-go/runagent/pkg/constants/constants.go rename to runagent-go/internal/constants/constants.go diff --git a/runagent-go/runagent/pkg/db/db.go b/runagent-go/internal/db/db.go similarity index 99% rename from runagent-go/runagent/pkg/db/db.go rename to runagent-go/internal/db/db.go index f3bc5a0..8694f3d 100644 --- a/runagent-go/runagent/pkg/db/db.go +++ b/runagent-go/internal/db/db.go @@ -8,7 +8,7 @@ import ( "time" _ "github.com/mattn/go-sqlite3" - "github.com/runagent-dev/runagent/runagent-go/runagent/pkg/constants" + "github.com/runagent-dev/runagent-go/internal/constants" ) // Agent represents an agent in the database diff --git a/runagent-go/runagent/pkg/server/server.go b/runagent-go/internal/server/server.go similarity index 99% rename from runagent-go/runagent/pkg/server/server.go rename to runagent-go/internal/server/server.go index 46ffb9f..7ac7930 100644 --- a/runagent-go/runagent/pkg/server/server.go +++ b/runagent-go/internal/server/server.go @@ -9,7 +9,7 @@ import ( "time" "github.com/gorilla/mux" - "github.com/runagent-dev/runagent/runagent-go/runagent/pkg/types" + "github.com/runagent-dev/runagent-go/internal/types" ) // Server represents a local RunAgent server diff --git a/runagent-go/runagent/pkg/types/types.go b/runagent-go/internal/types/types.go similarity index 100% rename from runagent-go/runagent/pkg/types/types.go rename to runagent-go/internal/types/types.go diff --git a/runagent-go/runagent/pkg/utils/port.go b/runagent-go/internal/utils/port.go similarity index 95% rename from runagent-go/runagent/pkg/utils/port.go rename to runagent-go/internal/utils/port.go index a048114..0ba94b0 100644 --- a/runagent-go/runagent/pkg/utils/port.go +++ b/runagent-go/internal/utils/port.go @@ -4,7 +4,7 @@ import ( "fmt" "net" - "github.com/runagent-dev/runagent/runagent-go/runagent/pkg/constants" + "github.com/runagent-dev/runagent-go/internal/constants" ) // PortManager manages port allocation diff --git a/runagent-go/runagent/stream.go b/runagent-go/stream.go similarity index 100% rename from runagent-go/runagent/stream.go rename to runagent-go/stream.go diff --git a/runagent-go/runagent/types.go b/runagent-go/types.go similarity index 100% rename from runagent-go/runagent/types.go rename to runagent-go/types.go diff --git a/runagent-go/runagent/version.go b/runagent-go/version.go similarity index 100% rename from runagent-go/runagent/version.go rename to runagent-go/version.go diff --git a/runagent-rust/runagent/src/utils/serializer.rs b/runagent-rust/runagent/src/utils/serializer.rs index 5471306..098fb8a 100644 --- a/runagent-rust/runagent/src/utils/serializer.rs +++ b/runagent-rust/runagent/src/utils/serializer.rs @@ -307,10 +307,10 @@ mod tests { MessageType::Status, serde_json::json!({"status": "ok"}), ); - + let result = serializer.serialize_message(&message); assert!(result.is_ok()); - + let serialized = result.unwrap(); let deserialized = serializer.deserialize_message(&serialized); assert!(deserialized.is_ok()); @@ -321,7 +321,7 @@ mod tests { let serializer = CoreSerializer::new(0.001).unwrap(); // Very small limit let small_str = "test"; let large_str = "a".repeat(2000); - + assert!(serializer.check_size_limit(small_str)); assert!(!serializer.check_size_limit(&large_str)); } @@ -329,13 +329,13 @@ mod tests { #[test] fn test_json_serializable_check() { let serializer = CoreSerializer::new(10.0).unwrap(); - + let simple_obj = serde_json::json!({"key": "value"}); assert!(serializer.is_json_serializable(&simple_obj)); - + let null_obj = Value::Null; assert!(serializer.is_json_serializable(&null_obj)); - + let array_obj = serde_json::json!([1, 2, 3]); assert!(serializer.is_json_serializable(&array_obj)); } @@ -343,7 +343,7 @@ mod tests { #[test] fn test_nested_reconstruction() { let serializer = CoreSerializer::new(10.0).unwrap(); - + let nested_data = serde_json::json!({ "level1": { "level2": { @@ -351,10 +351,10 @@ mod tests { } } }); - + let result = serializer.reconstruct_nested_json(nested_data.clone()); assert!(result.is_ok()); - + let reconstructed = result.unwrap(); assert_eq!(reconstructed, nested_data); }