fix: enhance npm publish step to include versioning#28
fix: enhance npm publish step to include versioning#28
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the GitHub Actions release workflow to incorporate an explicit versioning command in the Sigil publish step before publishing to npm.
Changes:
- Adds a shell block to read
packages/sigil/package.json’s version and runnpm versionbeforebun publishfor Sigil.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.github/workflows/npm-publish.yml
Outdated
| npm version $PACKAGE_VERSION --no-git-tag-version | ||
| cd packages/sigil && bun publish --access public |
There was a problem hiding this comment.
npm version $PACKAGE_VERSION --no-git-tag-version is executed from the repo root, but PACKAGE_VERSION is read from packages/sigil/package.json. As written, this updates the root package.json (and potentially root lockfiles) rather than the packages/sigil package, which is likely not what you want for the Sigil publish step. Run the version command within packages/sigil (or use npm --prefix packages/sigil …) so the correct package.json is updated, or remove this if versioning is already handled by bun sync.
| npm version $PACKAGE_VERSION --no-git-tag-version | |
| cd packages/sigil && bun publish --access public | |
| cd packages/sigil && npm version "$PACKAGE_VERSION" --no-git-tag-version && bun publish --access public |
.github/workflows/npm-publish.yml
Outdated
| PACKAGE_VERSION=$(cat packages/sigil/package.json | jq -r .version) | ||
| npm version $PACKAGE_VERSION --no-git-tag-version |
There was a problem hiding this comment.
The PACKAGE_VERSION extraction uses a useless cat pipeline and the variable is unquoted when passed to npm version. Prefer jq -r '.version' packages/sigil/package.json and quote the expansion when used to avoid accidental word-splitting if the value ever contains unexpected characters.
| PACKAGE_VERSION=$(cat packages/sigil/package.json | jq -r .version) | |
| npm version $PACKAGE_VERSION --no-git-tag-version | |
| PACKAGE_VERSION=$(jq -r '.version' packages/sigil/package.json) | |
| npm version "$PACKAGE_VERSION" --no-git-tag-version |
No description provided.