Skip to content

Commit

Permalink
fix: sync published version from main package.json (#540)
Browse files Browse the repository at this point in the history
  • Loading branch information
harelmo-lumigo authored Nov 11, 2024
1 parent ef28eb9 commit 3121f21
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"@grpc/grpc-js": "^1.9.0",
"@jest/globals": "^29.4.0",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^8.0.5",
"@types/deasync": "^0.1.5",
Expand Down Expand Up @@ -134,7 +135,13 @@
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/github"
"@semantic-release/github",
[
"@semantic-release/exec",
{
"prepareCmd": "./scripts/update_dist_version.sh ${nextRelease.version}"
}
]
]
},
"husky": {
Expand Down
12 changes: 12 additions & 0 deletions scripts/update_dist_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

next_version=$1

pushd ./dist
if [ ! -f "package.json" ]; then
echo "File dist/package.json found."
exit 1
fi

jq ".version = \"$next_version\"" package.json > package.tmp.json && mv package.tmp.json package.json
popd

0 comments on commit 3121f21

Please sign in to comment.