From 4b602b8174e48df5d470dff6445bd379e8dc6458 Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Sun, 18 Jan 2026 13:09:10 -0500 Subject: [PATCH] chore: Add set-version script and update all clients to 4.2.0 - Add scripts/set-version.sh to update version in all source files - Add make set-version VERSION=X.Y.Z target - Updated 11 files: VERSION, C, Python, Lua, Perl, Groovy, JS, Rust --- Makefile | 15 ++- clients/c/src/un.c | 2 +- clients/groovy/sync/src/un.groovy | 2 +- clients/javascript/async/package.json | 2 +- clients/lua/sync/src/un.lua | 2 +- clients/perl/sync/src/un.pl | 2 +- clients/python/async/setup.py | 2 +- clients/python/sync/setup.py | 2 +- clients/python/sync/src/__init__.py | 2 +- clients/rust/async/Cargo.toml | 2 +- clients/rust/sync/Cargo.toml | 2 +- scripts/set-version.sh | 149 ++++++++++++++++++++++++++ 12 files changed, 173 insertions(+), 11 deletions(-) create mode 100755 scripts/set-version.sh diff --git a/Makefile b/Makefile index 1c10465..c732f1e 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: help test test-all test-c test-python test-go test-javascript test-ruby test-php test-rust test-java test-bash test-perl test-lua +.PHONY: help test test-all test-c test-python test-go test-javascript test-ruby test-php test-rust test-java test-bash test-perl test-lua set-version # Client directories with their own Makefiles CLIENTS_WITH_MAKEFILE := $(wildcard clients/*/Makefile) @@ -32,6 +32,7 @@ help: @echo " make test-ci-locally # Simulate CI pipeline" @echo " make lint # Lint all clients" @echo " make clean # Clean build artifacts" + @echo " make set-version VERSION=X.Y.Z # Set version in all files" @echo "" @echo "Available client Makefiles:" @for dir in $(CLIENT_DIRS); do echo " $$dir"; done @@ -295,3 +296,15 @@ clean: @find . -name "*.pyc" -delete @find . -name "__pycache__" -type d -delete @echo "Clean complete" + +# ============================================================================ +# Version Management +# ============================================================================ + +.PHONY: set-version +set-version: +ifndef VERSION + @echo "Usage: make set-version VERSION=4.2.0" + @exit 1 +endif + @bash scripts/set-version.sh $(VERSION) diff --git a/clients/c/src/un.c b/clients/c/src/un.c index 520435e..7bee5f1 100644 --- a/clients/c/src/un.c +++ b/clients/c/src/un.c @@ -5938,7 +5938,7 @@ void print_usage(const char *prog) { * ============================================================================ */ const char *unsandbox_version(void) { - return "2.0.0"; + return "4.2.0"; } const char *unsandbox_detect_language(const char *filename) { diff --git a/clients/groovy/sync/src/un.groovy b/clients/groovy/sync/src/un.groovy index a16e49c..1df3cf6 100644 --- a/clients/groovy/sync/src/un.groovy +++ b/clients/groovy/sync/src/un.groovy @@ -72,7 +72,7 @@ * * * @author Permacomputer Project - * @version 2.0.0 + * @version 4.2.0 */ import javax.crypto.Mac diff --git a/clients/javascript/async/package.json b/clients/javascript/async/package.json index 70147bf..7cf21cb 100644 --- a/clients/javascript/async/package.json +++ b/clients/javascript/async/package.json @@ -1,6 +1,6 @@ { "name": "un-async", - "version": "2.0.0", + "version": "4.2.0", "description": "Unsandbox async JavaScript SDK - Execute code in 50+ languages", "main": "src/un_async.js", "type": "module", diff --git a/clients/lua/sync/src/un.lua b/clients/lua/sync/src/un.lua index af9ffb9..f35c1d7 100644 --- a/clients/lua/sync/src/un.lua +++ b/clients/lua/sync/src/un.lua @@ -15,7 +15,7 @@ local ltn12 = require("ltn12") local Un = {} Un.API_BASE = "https://api.unsandbox.com" -Un.VERSION = "2.0.0" +Un.VERSION = "4.2.0" -- Credential loading function Un.load_accounts_csv(path) diff --git a/clients/perl/sync/src/un.pl b/clients/perl/sync/src/un.pl index a874c8e..a365fcd 100644 --- a/clients/perl/sync/src/un.pl +++ b/clients/perl/sync/src/un.pl @@ -47,7 +47,7 @@ use Digest::HMAC_SHA256 qw(hmac_sha256_hex); use File::HomeDir; use Time::HiRes qw(time sleep); -our $VERSION = "2.0.0"; +our $VERSION = "4.2.0"; our $API_BASE = 'https://api.unsandbox.com'; # Credential system diff --git a/clients/python/async/setup.py b/clients/python/async/setup.py index 2119864..215adf9 100644 --- a/clients/python/async/setup.py +++ b/clients/python/async/setup.py @@ -7,7 +7,7 @@ from setuptools import setup, find_packages setup( name="unsandbox-async", - version="1.0.0", + version="4.2.0", description="Asynchronous Python SDK for unsandbox.com code execution", long_description=open("README.md").read() if False else "Async Python SDK for unsandbox code execution", author="unsandbox.com", diff --git a/clients/python/sync/setup.py b/clients/python/sync/setup.py index baa7486..9bfc6e9 100644 --- a/clients/python/sync/setup.py +++ b/clients/python/sync/setup.py @@ -7,7 +7,7 @@ with open("README.md", "r", encoding="utf-8") as fh: setup( name="unsandbox", - version="1.0.0", + version="4.2.0", author="Unsandbox", description="Synchronous Python SDK for unsandbox.com code execution", long_description=long_description, diff --git a/clients/python/sync/src/__init__.py b/clients/python/sync/src/__init__.py index f769e47..e0e6d39 100644 --- a/clients/python/sync/src/__init__.py +++ b/clients/python/sync/src/__init__.py @@ -27,7 +27,7 @@ from .un import ( CredentialsError, ) -__version__ = "1.0.0" +__version__ = "4.2.0" __all__ = [ "execute_code", "execute_async", diff --git a/clients/rust/async/Cargo.toml b/clients/rust/async/Cargo.toml index 40f8ced..a1be5fc 100644 --- a/clients/rust/async/Cargo.toml +++ b/clients/rust/async/Cargo.toml @@ -7,7 +7,7 @@ [package] name = "un-async" -version = "2.0.0" +version = "4.2.0" edition = "2021" authors = ["unsandbox.com"] description = "Asynchronous Rust SDK for unsandbox.com secure code execution API" diff --git a/clients/rust/sync/Cargo.toml b/clients/rust/sync/Cargo.toml index 9e918d9..76f0f28 100644 --- a/clients/rust/sync/Cargo.toml +++ b/clients/rust/sync/Cargo.toml @@ -7,7 +7,7 @@ [package] name = "un-sync" -version = "2.0.0" +version = "4.2.0" edition = "2021" authors = ["unsandbox.com"] description = "Synchronous Rust SDK for unsandbox.com secure code execution API" diff --git a/scripts/set-version.sh b/scripts/set-version.sh new file mode 100755 index 0000000..712bfee --- /dev/null +++ b/scripts/set-version.sh @@ -0,0 +1,149 @@ +#!/bin/bash +# Set version across VERSION file and all client source files +# Usage: scripts/set-version.sh 4.2.0 +# Or: make set-version VERSION=4.2.0 + +set -e + +VERSION="${1:-}" + +if [ -z "$VERSION" ]; then + echo "Usage: $0 " + echo "Example: $0 4.2.0" + exit 1 +fi + +# Validate version format (X.Y.Z) +if ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then + echo "Error: Version must be in format X.Y.Z (e.g., 4.2.0)" + exit 1 +fi + +echo "Setting version to $VERSION..." + +# Track files updated +UPDATED=0 + +# 1. VERSION file +echo "$VERSION" > VERSION +echo " ✓ VERSION" +UPDATED=$((UPDATED + 1)) + +# 2. C SDK - unsandbox_version() return value +if [ -f "clients/c/src/un.c" ]; then + sed -i "s/return \"[0-9]\+\.[0-9]\+\.[0-9]\+\";/return \"$VERSION\";/" clients/c/src/un.c + echo " ✓ clients/c/src/un.c" + UPDATED=$((UPDATED + 1)) +fi + +# 3. Python sync __init__.py +if [ -f "clients/python/sync/src/__init__.py" ]; then + sed -i "s/__version__ = \"[0-9]\+\.[0-9]\+\.[0-9]\+\"/__version__ = \"$VERSION\"/" clients/python/sync/src/__init__.py + echo " ✓ clients/python/sync/src/__init__.py" + UPDATED=$((UPDATED + 1)) +fi + +# 4. Python sync setup.py +if [ -f "clients/python/sync/setup.py" ]; then + sed -i "s/version=\"[0-9]\+\.[0-9]\+\.[0-9]\+\"/version=\"$VERSION\"/" clients/python/sync/setup.py + echo " ✓ clients/python/sync/setup.py" + UPDATED=$((UPDATED + 1)) +fi + +# 5. Python async setup.py +if [ -f "clients/python/async/setup.py" ]; then + sed -i "s/version=\"[0-9]\+\.[0-9]\+\.[0-9]\+\"/version=\"$VERSION\"/" clients/python/async/setup.py + echo " ✓ clients/python/async/setup.py" + UPDATED=$((UPDATED + 1)) +fi + +# 6. Lua SDK +if [ -f "clients/lua/sync/src/un.lua" ]; then + sed -i "s/Un\.VERSION = \"[0-9]\+\.[0-9]\+\.[0-9]\+\"/Un.VERSION = \"$VERSION\"/" clients/lua/sync/src/un.lua + echo " ✓ clients/lua/sync/src/un.lua" + UPDATED=$((UPDATED + 1)) +fi + +# 7. Perl SDK +if [ -f "clients/perl/sync/src/un.pl" ]; then + sed -i "s/our \$VERSION = \"[0-9]\+\.[0-9]\+\.[0-9]\+\";/our \$VERSION = \"$VERSION\";/" clients/perl/sync/src/un.pl + echo " ✓ clients/perl/sync/src/un.pl" + UPDATED=$((UPDATED + 1)) +fi + +# 8. Groovy SDK (javadoc @version tag) +if [ -f "clients/groovy/sync/src/un.groovy" ]; then + sed -i "s/@version [0-9]\+\.[0-9]\+\.[0-9]\+/@version $VERSION/" clients/groovy/sync/src/un.groovy + echo " ✓ clients/groovy/sync/src/un.groovy" + UPDATED=$((UPDATED + 1)) +fi + +# 9. JavaScript package.json (if exists) +if [ -f "clients/javascript/sync/package.json" ]; then + sed -i "s/\"version\": \"[0-9]\+\.[0-9]\+\.[0-9]\+\"/\"version\": \"$VERSION\"/" clients/javascript/sync/package.json + echo " ✓ clients/javascript/sync/package.json" + UPDATED=$((UPDATED + 1)) +fi + +if [ -f "clients/javascript/async/package.json" ]; then + sed -i "s/\"version\": \"[0-9]\+\.[0-9]\+\.[0-9]\+\"/\"version\": \"$VERSION\"/" clients/javascript/async/package.json + echo " ✓ clients/javascript/async/package.json" + UPDATED=$((UPDATED + 1)) +fi + +# 10. TypeScript package.json (if exists) +if [ -f "clients/typescript/sync/package.json" ]; then + sed -i "s/\"version\": \"[0-9]\+\.[0-9]\+\.[0-9]\+\"/\"version\": \"$VERSION\"/" clients/typescript/sync/package.json + echo " ✓ clients/typescript/sync/package.json" + UPDATED=$((UPDATED + 1)) +fi + +# 11. Rust Cargo.toml (if exists) +if [ -f "clients/rust/sync/Cargo.toml" ]; then + sed -i "s/^version = \"[0-9]\+\.[0-9]\+\.[0-9]\+\"/version = \"$VERSION\"/" clients/rust/sync/Cargo.toml + echo " ✓ clients/rust/sync/Cargo.toml" + UPDATED=$((UPDATED + 1)) +fi + +if [ -f "clients/rust/async/Cargo.toml" ]; then + sed -i "s/^version = \"[0-9]\+\.[0-9]\+\.[0-9]\+\"/version = \"$VERSION\"/" clients/rust/async/Cargo.toml + echo " ✓ clients/rust/async/Cargo.toml" + UPDATED=$((UPDATED + 1)) +fi + +# 12. Go module (if has version constant) +for gofile in clients/go/sync/src/un.go clients/go/async/src/un_async.go; do + if [ -f "$gofile" ]; then + if grep -q 'Version.*=.*"[0-9]\+\.[0-9]\+\.[0-9]\+"' "$gofile"; then + sed -i "s/Version.*=.*\"[0-9]\+\.[0-9]\+\.[0-9]\+\"/Version = \"$VERSION\"/" "$gofile" + echo " ✓ $gofile" + UPDATED=$((UPDATED + 1)) + fi + fi +done + +# 13. Ruby gemspec or version constant +if [ -f "clients/ruby/sync/src/un.rb" ]; then + if grep -q 'VERSION.*=.*"[0-9]\+\.[0-9]\+\.[0-9]\+"' "clients/ruby/sync/src/un.rb"; then + sed -i "s/VERSION.*=.*\"[0-9]\+\.[0-9]\+\.[0-9]\+\"/VERSION = \"$VERSION\"/" clients/ruby/sync/src/un.rb + echo " ✓ clients/ruby/sync/src/un.rb" + UPDATED=$((UPDATED + 1)) + fi +fi + +# 14. Java/Kotlin version in source (if exists) +for javafile in clients/java/sync/src/Un.java clients/kotlin/sync/src/un.kt; do + if [ -f "$javafile" ]; then + if grep -q 'VERSION.*=.*"[0-9]\+\.[0-9]\+\.[0-9]\+"' "$javafile"; then + sed -i "s/VERSION.*=.*\"[0-9]\+\.[0-9]\+\.[0-9]\+\"/VERSION = \"$VERSION\"/" "$javafile" + echo " ✓ $javafile" + UPDATED=$((UPDATED + 1)) + fi + fi +done + +echo "" +echo "Done! Updated $UPDATED files to version $VERSION" +echo "" +echo "Verify with:" +echo " grep -rn '$VERSION' VERSION clients/*/sync/src/* clients/*/async/src/* 2>/dev/null | grep -v node_modules | head -20"