Skip to content

Commit 93dc00d

Browse files
committed
fix(cli): updated the --version command
1 parent c1b2d9d commit 93dc00d

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

.github/workflows/release.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ jobs:
4141
run: pnpm turbo build
4242

4343
- name: Generate CLI executable
44-
run: bash ./scripts/build-cli.sh
44+
run:
45+
bash ./scripts/bump-cli-version.sh ${{ github.event.inputs.versionType }}
46+
bash ./scripts/build-cli.sh
4547

4648
- name: Release
4749
run: pnpm release-it --ci --increment=${{ github.event.inputs.versionType }} --config=packages/lib/.release-it.json

packages/lib/.release-it.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"@release-it/bumper": {
88
"in": "packages/lib/package.json",
9-
"out": ["packages/lib/package.json", "packages/cli/package.json"]
9+
"out": ["packages/lib/package.json"]
1010
}
1111
},
1212
"github": {

packages/lib/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
### Fixes 🐛
11+
12+
- Updated the `--version` command to display the version correctly
13+
814
## [0.0.14] - 2024-10-20
915

1016
### Fixes 🐛

scripts/bump-cli-version.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
if [ -z "$1" ]; then
4+
echo "Error: No version type provided."
5+
echo "Usage: $0 [patch|minor|major|<specific-version>]"
6+
exit 1
7+
fi
8+
9+
version_type=$1
10+
11+
cd packages/cli
12+
npm version $version_type --no-git-tag-version
13+
14+
if [ $? -eq 0 ]; then
15+
echo "Version bumped successfully to $(npm pkg get version | tr -d '\"')"
16+
else
17+
echo "Error: Failed to bump the version."
18+
exit 1
19+
fi
20+

0 commit comments

Comments
 (0)