Skip to content

Commit 4a43ddc

Browse files
committed
fixup! ci: remove lerna, leverage basic shell script
1 parent 0f807cd commit 4a43ddc

File tree

2 files changed

+28
-16
lines changed

2 files changed

+28
-16
lines changed

.github/scripts/publish.sh

+21-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
11
#!/bin/sh
22
set -e
33

4-
# List of packages to publish
5-
# CHANGE IT WHEN ADDING A NEW PROJECT TO BE RELEASED.
6-
PACKAGES=(
7-
"ui-icons"
8-
"ui-core"
9-
"ui-speedspacechart"
10-
"ui-spacetimechart"
11-
"ui-manchette"
4+
# List of packages to prevent from publishing
5+
EXCLUDED_PACKAGES=(
6+
"storybook"
127
)
138

9+
# List of packages in the workspace
10+
WORKSPACE_PACKAGES=$(jq -r '.workspaces[]' package.json)
11+
WORKSPACE_PACKAGES_ARRAY=($WORKSPACE_PACKAGES)
12+
13+
# We substract the excluded packages from the workspace packages
14+
PACKAGES=()
15+
for package in "${WORKSPACE_PACKAGES_ARRAY[@]}"; do
16+
if [[ ! " ${EXCLUDED_PACKAGES[@]} " =~ " ${package} " ]]; then
17+
PACKAGES+=("$package")
18+
fi
19+
done
20+
21+
# Print the filtered list of packages
22+
echo "::group::Packages to publish"
23+
echo "${PACKAGES[@]}"
24+
echo "::endgroup::"
25+
1426
# Get the version from the tag
1527
VERSION=${GITHUB_REF/refs\/tags\//}
1628

@@ -42,7 +54,7 @@ version_and_publish() {
4254
mv package.tmp.json package.json
4355

4456
# Publish the package
45-
npm publish
57+
# npm publish
4658

4759
# Back to root
4860
popd

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ In summary : we consider a version number as being an indivisible release of all
2727

2828
### Adding a new package to the monorepo
2929

30-
1. Create a folder and follow the structure of the other packages (refer to the Development section for more information).
31-
2. In the file `./.github/scripts/publish.sh`, search for the PACKAGES array and add your package in it. See below:
30+
Create a folder and follow the structure of the other packages (refer to the Development section for more information).
31+
32+
- The package will be picked up automatically as long as it is included in the workspaces of the `package.json` file at the root of the project.
33+
- If you need the project to be excluded from publishing whil being on the workspace, you need to edit the file `./.github/scripts/publish.sh`, search for the EXCLUDED_PACKAGES array and add your package in it. See below:
3234

3335
```bash
34-
# List of packages to publish
35-
# CHANGE IT WHEN ADDING A NEW PROJECT TO BE RELEASED.
36-
PACKAGES=(
37-
"ui-icons"
38-
"ui-core"
36+
# List of packages to prevent from publishing
37+
EXCLUDED_PACKAGES=(
38+
"storybook"
3939
# <- Add your package here (it's a bash array)
4040
)
4141
```

0 commit comments

Comments
 (0)