prometeu-runtime/scripts/local-dist.sh
2026-01-21 08:36:22 +00:00

35 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
set -e
# Generate version
./scripts/gen-version.sh
VERSION=$(cat VERSION.txt)
# Prepare staging for SDK extra files
echo "Preparing dist-staging..."
rm -rf dist-staging/devtools/debugger-protocol
rm -rf dist-staging/devtools/prometeu-sdk
mkdir -p dist-staging/devtools/debugger-protocol
mkdir -p dist-staging/devtools/prometeu-sdk
cp devtools/debugger-protocol/protocol.json dist-staging/devtools/debugger-protocol/
cp -R devtools/prometeu-sdk dist-staging/devtools
cp VERSION.txt dist-staging/devtools/debugger-protocol/VERSION.txt
cp VERSION.txt dist-staging/devtools/prometeu-sdk/VERSION.txt
# Clean and prepare the version-specific directory
echo "Cleaning dist-staging/stable/$VERSION..."
rm -rf "dist-staging/stable/$VERSION"
mkdir -p "dist-staging/stable/$VERSION"
# Build stable using cargo build
dist build
echo "Copying target/distrib content to dist-staging/stable/$VERSION..."
if [ -d "target/distrib" ] && [ "$(ls -A target/distrib)" ]; then
cp -r target/distrib/* "dist-staging/stable/$VERSION/"
else
echo "Warning: target/dist directory not found or empty."
fi