2020-01-16 14:51:55 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-01-07 17:13:21 +01:00
|
|
|
# Force start from root folder
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2025-01-15 10:53:45 +02:00
|
|
|
version=$VERSION
|
|
|
|
distTag=$DIST_TAG
|
2020-01-07 17:13:21 +01:00
|
|
|
|
2025-01-15 10:53:45 +02:00
|
|
|
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
|
2020-01-07 17:13:21 +01:00
|
|
|
|
2025-01-15 14:42:29 +02:00
|
|
|
# Ensure GitHub token is available
|
|
|
|
if [[ -z "$GITHUB_TOKEN" ]]; then
|
|
|
|
echo "Error: GITHUB_TOKEN environment variable is not set."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2025-01-28 15:16:26 +02:00
|
|
|
# Configure Git
|
2025-01-15 14:42:29 +02:00
|
|
|
git config --global user.name "${GITHUB_ACTOR}"
|
|
|
|
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
|
|
|
|
|
2020-01-07 17:13:21 +01:00
|
|
|
# publish packages
|
2023-12-19 13:21:33 +00:00
|
|
|
./node_modules/.bin/nx run-many --target=clean --nx-ignore-cycles
|
2024-01-12 12:48:45 +01:00
|
|
|
./node_modules/.bin/nx run-many --target=build --nx-ignore-cycles --skip-nx-cache
|
2025-01-15 14:42:29 +02:00
|
|
|
GITHUB_TOKEN=$GITHUB_TOKEN yarn release --version "$version" --tag "$distTag" --dry-run false "$@"
|