forked from diffusionstudio/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish.sh
More file actions
41 lines (31 loc) · 825 Bytes
/
publish.sh
File metadata and controls
41 lines (31 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
# Step 1: Run Vitest for unit testing in "run" mode to avoid waiting for changes
echo "Running unit tests with Vitest..."
npx vitest run
# Check if the tests were successful
if [ $? -ne 0 ]; then
echo "Tests failed. Aborting publish."
exit 1
fi
echo "Tests passed. Proceeding with build and publish..."
# Step 2: Remove the dist folder
echo "Removing dist folder..."
rm -rf dist
# Step 3: Build the library
echo "Building the library..."
npm run build
# Check if the build was successful
if [ $? -ne 0 ]; then
echo "Build failed. Aborting publish."
exit 1
fi
echo "Build successful."
# Step 4: Publish the package
echo "Publishing the package..."
npm publish
# Check if the publish was successful
if [ $? -ne 0 ]; then
echo "Publish failed."
exit 1
fi
echo "Package published successfully!"