From 01d6ee6890251a79f6510dad86dbdb11e84167e2 Mon Sep 17 00:00:00 2001 From: Anmol1696 Date: Mon, 7 Apr 2025 10:31:12 +0530 Subject: [PATCH] try to unify all versions to one --- VERSION | 1 + clients/js/package.json | 10 +++-- clients/js/packages/starshipjs/package.json | 2 +- scripts/sync-version.sh | 44 +++++++++++++++++++++ starship/charts/devnet/Chart.yaml | 2 +- 5 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 VERSION create mode 100644 scripts/sync-version.sh diff --git a/VERSION b/VERSION new file mode 100644 index 00000000..35f0dee0 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +3.7.0 \ No newline at end of file diff --git a/clients/js/package.json b/clients/js/package.json index 4e1e6e9f..ae4181aa 100644 --- a/clients/js/package.json +++ b/clients/js/package.json @@ -1,6 +1,6 @@ { "name": "starship-js", - "version": "0.0.1", + "version": "3.7.0", "author": "Dan Lynch ", "private": true, "repository": { @@ -21,9 +21,11 @@ "lint": "lerna run lint", "format": "lerna run format", "postinstall": "yarn symlink", - "publish": "yarn build; yarn lerna publish --no-private", - "publish:minor": "yarn build; yarn lerna publish minor --no-private", - "publish:major": "yarn build; yarn lerna publish major --no-private" + "version": "bash ../../scripts/sync-version.sh sync", + "prepublishOnly": "yarn build", + "publish": "lerna version --conventional-commits --yes && lerna publish from-package --yes", + "publish:minor": "lerna version minor --conventional-commits --yes && lerna publish from-package --yes", + "publish:major": "lerna version major --conventional-commits --yes && lerna publish from-package --yes" }, "devDependencies": { "@types/jest": "^29.5.11", diff --git a/clients/js/packages/starshipjs/package.json b/clients/js/packages/starshipjs/package.json index 43dec454..8aced731 100644 --- a/clients/js/packages/starshipjs/package.json +++ b/clients/js/packages/starshipjs/package.json @@ -1,6 +1,6 @@ { "name": "starshipjs", - "version": "3.3.0", + "version": "3.7.0", "author": "Dan Lynch ", "description": "JS utilities for Starship", "main": "index.js", diff --git a/scripts/sync-version.sh b/scripts/sync-version.sh new file mode 100644 index 00000000..3ec30f15 --- /dev/null +++ b/scripts/sync-version.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +# Exit on error +set -e + +# Function to read version from VERSION file +read_version() { + cat VERSION | tr -d '[:space:]' +} + +# Function to sync version across all files +sync_version() { + local version=$1 + echo "Syncing version $version across all files..." + + # Update Chart.yaml + echo "Updating Chart.yaml..." + sed -i '' "s/^version: .*/version: $version/" starship/charts/devnet/Chart.yaml + + # Update root package.json + echo "Updating root package.json..." + sed -i '' "s/\"version\": \".*\"/\"version\": \"$version\"/" clients/js/package.json + + # Update all package.json files in packages + echo "Updating package.json files in packages..." + find clients/js/packages -name "package.json" -exec sed -i '' "s/\"version\": \".*\"/\"version\": \"$version\"/" {} \; + + echo "Version sync complete!" +} + +# Main script logic +case "$1" in + "read") + read_version + ;; + "sync") + version=$(read_version) + sync_version "$version" + ;; + *) + echo "Usage: $0 {read|sync}" + exit 1 + ;; +esac \ No newline at end of file diff --git a/starship/charts/devnet/Chart.yaml b/starship/charts/devnet/Chart.yaml index 08e36ab8..f176aa03 100644 --- a/starship/charts/devnet/Chart.yaml +++ b/starship/charts/devnet/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.6.0 +version: 3.7.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to