Skip to content

Commit 5280bec

Browse files
wishket-pjwJeremyDev87
authored andcommitted
fix: Use jq instead of npm version in release workflow
- Replace npm version command with jq for package version updates - Consolidate version and dependency updates in codingbuddy publishing step
1 parent 7844cd5 commit 5280bec

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
TAG_NAME="${GITHUB_REF#refs/tags/}"
3232
TAG_NAME="${TAG_NAME#v}"
3333
echo "Publishing codingbuddy-rules version: $TAG_NAME"
34-
npm version "$TAG_NAME" --no-git-tag-version
34+
cat <<< "$( jq --arg v "$TAG_NAME" '.version = $v' package.json )" > package.json
3535
yarn npm publish
3636
env:
3737
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -43,9 +43,8 @@ jobs:
4343
TAG_NAME="${GITHUB_REF#refs/tags/}"
4444
TAG_NAME="${TAG_NAME#v}"
4545
echo "Publishing codingbuddy version: $TAG_NAME"
46-
npm version "$TAG_NAME" --no-git-tag-version
47-
# Replace workspace dependency with actual version
48-
cat <<< "$( jq --arg v "$TAG_NAME" '.dependencies["codingbuddy-rules"] = $v' package.json )" > package.json
46+
# Update version and replace workspace dependency with actual version
47+
cat <<< "$( jq --arg v "$TAG_NAME" '.version = $v | .dependencies["codingbuddy-rules"] = $v' package.json )" > package.json
4948
yarn npm publish
5049
env:
5150
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)