Skip to content

Commit 3e670eb

Browse files
committed
Added deno build script
1 parent 245cff2 commit 3e670eb

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ results
1919
*.traineddata
2020
*.traineddata.gz
2121
settings.json
22-
tmp
22+
tmp
23+
/build/

build-deno-compile.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
## Note:
4+
## The Windows build does not work and the Mac build has never been tested.
5+
## The Linux build should work.
6+
7+
# Extract version from package.json using grep and sed
8+
VERSION=$(grep '"version"' package.json | sed -E 's/.*"version": *"([^"]+)".*/\1/')
9+
if [ -z "$VERSION" ]; then
10+
echo "Failed to extract version from package.json"
11+
exit 1
12+
fi
13+
14+
# Create build directory
15+
mkdir -p build
16+
17+
# Build for different platforms
18+
echo "Building for Linux x64..."
19+
deno compile --allow-sys --allow-read --allow-write --target x86_64-unknown-linux-gnu --output build/scribe-linux-x64 cli/scribe.js
20+
21+
echo "Building for macOS x64..."
22+
deno compile --allow-sys --allow-read --allow-write --target x86_64-apple-darwin --output build/scribe-macos-x64 cli/scribe.js
23+
24+
echo "Building for Windows x64..."
25+
deno compile --allow-sys --allow-read --allow-write --target x86_64-pc-windows-msvc --output build/scribe-windows-x64.exe cli/scribe.js
26+
27+
# Create checksums
28+
cd build
29+
sha256sum * > checksums.txt
30+
cd ..

0 commit comments

Comments
 (0)