-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11773 from owncloud/chore/release-tags-script
chore: scripts for updating versions and creating tags
- Loading branch information
Showing
3 changed files
with
64 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
# This script bumps the version in the package.json files of the main app | ||
# and all published packages to the provided version. | ||
# | ||
# NOTE: only run this if all packages are supposed to get the same version! | ||
|
||
apps=("design-system" "eslint-config" "web-pkg" "web-client" "web-test-helpers") | ||
|
||
NEW_VERSION="$1" | ||
|
||
if [ -z "$NEW_VERSION" ]; then | ||
echo "Error: No new version provided." | ||
echo "Usage: $0 <new_version>" | ||
exit 1 | ||
fi | ||
|
||
cd "$(dirname "$0")/../.." | ||
CURRENT_VERSION=$(node -p "require('./package.json').version") | ||
sed -i '' "s/\"version\": \"${CURRENT_VERSION}\"/\"version\": \"${NEW_VERSION}\"/" package.json | ||
|
||
for app in "${apps[@]}"; do | ||
cd "./packages/$app" | ||
CURRENT_VERSION=$(node -p "require('./package.json').version") | ||
sed -i '' "s/\"version\": \"${CURRENT_VERSION}\"/\"version\": \"${NEW_VERSION}\"/" package.json | ||
cd "../.." | ||
done | ||
|
||
echo "package.json files have been updated to version $NEW_VERSION" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
# This script creates and pushes tags for the main app and all published packages. | ||
|
||
APPS=("design-system" "eslint-config" "web-pkg" "web-client" "web-test-helpers") | ||
|
||
cd "$(dirname "$0")/../.." | ||
VERSION=$(node -p "require('./package.json').version") | ||
TAG="v${VERSION}" | ||
|
||
git tag "$TAG" | ||
git push origin "$TAG" | ||
echo "v$VERSION has been created and pushed" | ||
|
||
for app in "${APPS[@]}"; do | ||
cd "./packages/$app" | ||
|
||
VERSION=$(node -p "require('./package.json').version") | ||
TAG="${app}-v${VERSION}" | ||
|
||
git tag "$TAG" | ||
git push origin "$TAG" | ||
|
||
echo "$app-v$VERSION has been created and pushed" | ||
cd "../.." | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters