forked from hyperdxio/hyperdx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathversion.sh
executable file
·23 lines (17 loc) · 864 Bytes
/
version.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
yarn changeset version
# update root package.json version
API_LATEST_VERSION=$(sed -n 's/.*"version": "\([^"]*\)".*/\1/p' ./packages/api/package.json)
APP_LATEST_VERSION=$(sed -n 's/.*"version": "\([^"]*\)".*/\1/p' ./packages/app/package.json)
# check if api and app versions are the same
if [ "$API_LATEST_VERSION" != "$APP_LATEST_VERSION" ]; then
echo "API and APP versions are not the same. Please check and try again."
exit 1
fi
# update root package.json version
sed -i '' -e "s/\"version\": \".*\"/\"version\": \"$API_LATEST_VERSION\"/g" ./package.json
echo "Updated root package.json version to $API_LATEST_VERSION"
# update .env IMAGE_VERSION
sed -i '' -e "s/IMAGE_VERSION=.*/IMAGE_VERSION=$API_LATEST_VERSION/g" ./.env
echo "Updated .env IMAGE_VERSION to $API_LATEST_VERSION"
echo "Run 'make release' to publish new version to GHCR"