-
Notifications
You must be signed in to change notification settings - Fork 13
/
publish-beta-packages.sh
51 lines (41 loc) · 1.14 KB
/
publish-beta-packages.sh
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
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# Ensure that an argument is provided
if [ -z "$1" ]; then
echo "Error: Please provide a version argument."
exit 1
fi
# Source the package order
source package-order.sh
# Loop through each package directory
for pkg in "${DIRS[@]}"; do
# Get the package name from its package.json file
pkg_name=$(jq -r '.name' $pkg/package.json)
echo "Processing package: $pkg_name with version $1"
# Change to the package directory
if ! cd "$pkg"; then
echo "Error: Unable to change to directory: $pkg"
exit 1
fi
# Update the package version
if ! yarn version "$1"; then
echo "Error: Failed to update version for $pkg_name"
exit 1
fi
# Build the package
if ! yarn build; then
echo "Error: Failed to build $pkg_name"
exit 1
fi
# Publish the package with a "beta" tag
if ! yarn npm publish --tag beta; then
echo "Error: Failed to publish $pkg_name"
exit 1
fi
# Change back to the root directory
if ! cd - > /dev/null; then
echo "Error: Unable to change back to original directory"
exit 1
fi
echo "$pkg_name has been processed successfully."
done
echo "All packages processed."