Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,5 @@ plugins/javy_chainlink_sdk/target/

# Standard Test Build
.tools

pkg
8 changes: 5 additions & 3 deletions build-bins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ platforms=(
"bun-windows-x64:windows-x64:win32:x64"
)

output_dir="pkg/cli"

# Loop through each platform configuration
for platform_config in "${platforms[@]}"; do
# Split the configuration string
Expand All @@ -18,12 +20,12 @@ for platform_config in "${platforms[@]}"; do
echo "Building for $platform_arch..."

# Build the binary
bun build ./cli/run.ts --target="$bun_target" --compile --outfile "dist/bin/$platform_arch/bin/cre-build"
bun build ./cli/run.ts --target="$bun_target" --compile --outfile "$output_dir/$platform_arch/bin/cre-build"

chmod +x "dist/bin/$platform_arch/bin/cre-build"
chmod +x "$output_dir/$platform_arch/bin/cre-build"

# Create package.json for this platform
cat > "dist/bin/$platform_arch/package.json" << EOF
cat > "$output_dir/$platform_arch/package.json" << EOF
{
"name": "@chainlink/cre-build-$platform_arch",
"version": "0.0.1",
Expand Down
6 changes: 3 additions & 3 deletions build-npm-tar.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
sh build-pkg.sh

bun pm pack --destination ./dist
bun pm pack --destination ./pkg
# tar -cvzf backup.tgz ./dist

# Pack each platform-specific folder in dist/bin
for folder in dist/bin/*/; do
for folder in pkg/cli/*/; do
if [ -d "$folder" ] && [ -f "$folder/package.json" ]; then
echo "Packing $folder..."
(cd "$folder" && bun pm pack --destination ../..)
(cd "$folder" && bun pm pack --destination ../../../pkg)
fi
done
2 changes: 2 additions & 0 deletions build-pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ bun tsc --project tsconfig.build.json

sh build-bins.sh

mkdir -p dist/bin

cp bin/* dist/bin/
cp install.js dist/install.js

Expand Down
Binary file modified dist/javy-chainlink-sdk.plugin.wasm
Binary file not shown.
4 changes: 2 additions & 2 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
"emitDecoratorMetadata": true
},

"include": ["src/**/*"],
"exclude": ["ai/**/*"]
"include": ["src/index.ts", "src/sdk/**/*"],
"exclude": ["cli/**/*"]
}
Loading