Skip to content

Commit 85b69e5

Browse files
committed
bump typescript and python versions
1 parent 2f1c503 commit 85b69e5

File tree

4 files changed

+123
-2
lines changed

4 files changed

+123
-2
lines changed

dev/build/python.sh

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@ handle_error() {
1414

1515
echo "🐍 Building Python SDK..."
1616

17+
# Parse command line arguments
18+
BUMP_VERSION=false
19+
while [[ $# -gt 0 ]]; do
20+
case $1 in
21+
--bump-version)
22+
BUMP_VERSION=true
23+
shift
24+
;;
25+
*)
26+
echo "Unknown option: $1"
27+
echo "Usage: $0 [--bump-version]"
28+
exit 1
29+
;;
30+
esac
31+
done
32+
1733
# Check if virtual environment exists
1834
if [ ! -d ".venv" ]; then
1935
echo "🔧 Creating Python virtual environment..."
@@ -27,6 +43,36 @@ source .venv/bin/activate
2743
echo "📦 Installing Python dependencies..."
2844
pip install -e .[dev] --quiet
2945

46+
# Version bumping logic
47+
if [ "$BUMP_VERSION" = true ]; then
48+
echo "📝 Bumping version..."
49+
CURRENT_VERSION=$(grep '^version = ' pyproject.toml | cut -d'"' -f2)
50+
echo " Current version: $CURRENT_VERSION"
51+
52+
# Split version into parts
53+
IFS='.' read -r -a VERSION_PARTS <<< "$CURRENT_VERSION"
54+
MAJOR=${VERSION_PARTS[0]}
55+
MINOR=${VERSION_PARTS[1]}
56+
PATCH=${VERSION_PARTS[2]}
57+
58+
# Increment patch version
59+
NEW_PATCH=$((PATCH + 1))
60+
NEW_VERSION="$MAJOR.$MINOR.$NEW_PATCH"
61+
62+
echo " New version: $NEW_VERSION"
63+
64+
# Update pyproject.toml
65+
if [[ "$OSTYPE" == "darwin"* ]]; then
66+
# macOS
67+
sed -i '' "s/^version = \".*\"/version = \"$NEW_VERSION\"/" pyproject.toml
68+
else
69+
# Linux
70+
sed -i "s/^version = \".*\"/version = \"$NEW_VERSION\"/" pyproject.toml
71+
fi
72+
73+
echo " ✅ Version updated to $NEW_VERSION"
74+
fi
75+
3076
echo "🧪 Running Python tests..."
3177
export PYTHONPATH="./python/src:./python/tests"
3278
pytest python/tests --quiet
@@ -35,8 +81,27 @@ echo "🚀 Python linting and formatting..."
3581
ruff check . --fix --quiet
3682
ruff format . --quiet
3783

84+
echo "📦 Building distribution packages..."
85+
# Clean ALL previous builds (including any in root dist/)
86+
echo " 🧹 Cleaning previous builds..."
87+
rm -rf ./dist ./build ./python/dist ./python/build ./python/src/*.egg-info ./src/*.egg-info *.egg-info
88+
89+
# Build source distribution and wheel
90+
echo " 🔨 Creating distribution packages..."
91+
python -m build --outdir ./python/dist
92+
93+
echo " ✅ Distribution packages created:"
94+
ls -la ./python/dist/
95+
96+
echo
3897
echo "############################################################"
3998
echo "# #"
4099
echo "# 🎉 Python SDK build complete! 🐍 #"
41100
echo "# #"
101+
echo "# Distribution packages ready in ./python/dist/ #"
102+
echo "# #"
103+
echo "# To publish to PyPI: #"
104+
echo "# 1. Bump version: ./dev/build/python.sh --bump-version #"
105+
echo "# 2. Upload: twine upload ./python/dist/* #"
106+
echo "# #"
42107
echo "############################################################"

dev/build/typescript.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,59 @@ handle_error() {
1414

1515
echo "📦 Building TypeScript SDK..."
1616

17+
# Parse command line arguments
18+
BUMP_VERSION=false
19+
while [[ $# -gt 0 ]]; do
20+
case $1 in
21+
--bump-version)
22+
BUMP_VERSION=true
23+
shift
24+
;;
25+
*)
26+
echo "Unknown option: $1"
27+
echo "Usage: $0 [--bump-version]"
28+
exit 1
29+
;;
30+
esac
31+
done
32+
1733
# Ensure we're in the root directory
1834
cd "$ROOT_DIR"
1935

2036
echo "📦 Installing TypeScript dependencies..."
2137
cd ts
2238
yarn install --frozen-lockfile
2339

40+
# Version bumping logic
41+
if [ "$BUMP_VERSION" = true ]; then
42+
echo "📝 Bumping version..."
43+
CURRENT_VERSION=$(grep '"version":' package.json | head -1 | cut -d'"' -f4)
44+
echo " Current version: $CURRENT_VERSION"
45+
46+
# Split version into parts
47+
IFS='.' read -r -a VERSION_PARTS <<< "$CURRENT_VERSION"
48+
MAJOR=${VERSION_PARTS[0]}
49+
MINOR=${VERSION_PARTS[1]}
50+
PATCH=${VERSION_PARTS[2]}
51+
52+
# Increment patch version
53+
NEW_PATCH=$((PATCH + 1))
54+
NEW_VERSION="$MAJOR.$MINOR.$NEW_PATCH"
55+
56+
echo " New version: $NEW_VERSION"
57+
58+
# Update package.json
59+
if [[ "$OSTYPE" == "darwin"* ]]; then
60+
# macOS
61+
sed -i '' "s/\"version\": \".*\"/\"version\": \"$NEW_VERSION\"/" package.json
62+
else
63+
# Linux
64+
sed -i "s/\"version\": \".*\"/\"version\": \"$NEW_VERSION\"/" package.json
65+
fi
66+
67+
echo " ✅ Version updated to $NEW_VERSION"
68+
fi
69+
2470
echo "🚀 Building TypeScript library..."
2571
yarn build
2672

@@ -30,10 +76,20 @@ yarn test
3076
echo "🚀 Linting TypeScript code..."
3177
yarn lint
3278

79+
echo "✅ Build artifacts ready in ./dist/"
80+
ls -la dist/ | head -10
81+
3382
cd ..
3483

84+
echo
3585
echo "############################################################"
3686
echo "# #"
3787
echo "# 🎉 TypeScript SDK build complete! 📦 #"
3888
echo "# #"
89+
echo "# Build artifacts in ./ts/dist/ #"
90+
echo "# #"
91+
echo "# To publish to npm: #"
92+
echo "# 1. Bump version: ./dev/build/typescript.sh --bump-version #"
93+
echo "# 2. Publish: cd ts && yarn publish --access public #"
94+
echo "# #"
3995
echo "############################################################"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "meshtrade"
7-
version = "0.0.8"
7+
version = "0.0.10"
88
authors = [
99
{ name = "Bernard Bussy", email = "bernard@meshtrade.co" },
1010
]

ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@meshtrade/api",
3-
"version": "0.0.8",
3+
"version": "0.0.11",
44
"description": "Mesh Typescript SDK",
55
"author": "Bernard Bussy <bernard@meshtrade.co>",
66
"keywords": [

0 commit comments

Comments
 (0)