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
This commit is contained in:
russell@unturf.com 2026-01-18 13:09:10 -05:00
parent d76a56610e
commit 4b602b8174
12 changed files with 173 additions and 11 deletions

View file

@ -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)

View file

@ -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) {

View file

@ -72,7 +72,7 @@
* </ol>
*
* @author Permacomputer Project
* @version 2.0.0
* @version 4.2.0
*/
import javax.crypto.Mac

View file

@ -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",

View file

@ -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)

View file

@ -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

View file

@ -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",

View file

@ -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,

View file

@ -27,7 +27,7 @@ from .un import (
CredentialsError,
)
__version__ = "1.0.0"
__version__ = "4.2.0"
__all__ = [
"execute_code",
"execute_async",

View file

@ -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"

View file

@ -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"

149
scripts/set-version.sh Executable file
View file

@ -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 <version>"
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"