Skip to content

Commit

Permalink
[pre-release] [0.0.52] fix for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyGura committed Dec 12, 2024
1 parent 7f8707d commit d958262
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions etc/publish_new_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,32 @@ upgrade() {
popd
}

wait_package_publish() {
local package_name="$1"
local desired_version="$2"
local timeout_seconds=120
echo Waiting $package_name@$desired_version to be available before continuation
start_time=$(date +%s)
while true; do
current_version=$(npm view "$package_name" version)
end_time=$(date +%s)
elapsed_time=$((end_time - start_time))
if [ $elapsed_time -ge $timeout_seconds ]; then
echo "NPM package was not fully published after 2 minutes"
exit 1
fi
if [ "$current_version" = "$desired_version" ]; then
return
fi
sleep 10
done
}

pushd ./packages/core
sed -i 's/"version": "[0-9.]*",/"version": "'$1'",/' package.json
rm -rf node_modules/ package-lock.json dist/ && npm i && npm run prettier-format && npm run build
npm publish
echo Waiting 30s before continuation
sleep 30s
wait_package_publish "@gg-web-engine/core" $1
popd

pids=()
Expand All @@ -49,8 +69,10 @@ do
popd
done

echo Waiting 30s before continuation
sleep 30s
for ix in ${!libs[*]}
do
wait_package_publish "@gg-web-engine/${libs[$ix]}" $1
done

echo NPM packages published, re-linking examples...
examples=()
Expand Down

0 comments on commit d958262

Please sign in to comment.