mirror of
https://github.com/grafana/grafana.git
synced 2025-01-07 22:53:56 -06:00
5050822b9a
* move packed packages to npm-artifacts dir * remove unnecessary any to trigger canary build * update canary script to create dir only if it does not exist Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
29 lines
805 B
Bash
Executable File
29 lines
805 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -eo pipefail
|
|
|
|
# shellcheck source=./scripts/helpers/exit-if-fail.sh
|
|
source "$(dirname "$0")/helpers/exit-if-fail.sh"
|
|
|
|
# check if there were any changes to packages between current and previous commit
|
|
count=$(git diff HEAD~1..HEAD --name-only -- packages | awk '{c++} END {print c}')
|
|
|
|
if [ -z "$count" ]; then
|
|
echo "No changes in packages, skipping packages publishing"
|
|
else
|
|
echo "Changes detected in ${count} packages"
|
|
echo "Starting to release latest canary version"
|
|
|
|
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
|
|
|
|
if [ ! -d './npm-artifacts' ]; then
|
|
mkdir './npm-artifacts'
|
|
fi
|
|
|
|
echo $'\nPacking packages'
|
|
yarn packages:pack
|
|
|
|
echo $'\nPublishing packages'
|
|
for file in ./npm-artifacts/*.tgz; do npm publish "$file" --tag canary; done
|
|
|
|
fi
|