strapi/scripts/pre-publish.sh
2024-01-12 12:48:45 +01:00

25 lines
621 B
Bash
Executable File

#!/bin/bash
# Force start from root folder
cd "$(dirname "$0")/.."
set -e
version=$VERSION
distTag=$DIST_TAG
if [[ -z "$version" ]]; then
echo "Please enter the version you want to publish"
read -r version
fi
if [[ -z "$distTag" ]]; then
echo "Please enter the dist-tag you want to publish with"
read -r distTag
fi
# publish packages
./node_modules/.bin/nx run-many --target=clean --nx-ignore-cycles
./node_modules/.bin/nx run-many --target=build --nx-ignore-cycles --skip-nx-cache
./node_modules/.bin/lerna publish --no-push --no-git-tag-version --force-publish --exact "$version" --dist-tag "$distTag" $@