Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/node_sdk_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,14 @@ jobs:

- name: Bump version at package.json
run: |
sed -i "s/\"version\": \".*\"/\"version\": \"${{ github.event.release.tag_name }}\"/" package.json
cat package.json

# Bump only the top-level "version" field. npm is JSON-aware (unlike the
# previous greedy sed, which also rewrote scripts.version); no git
# tag/commit is created, re-runs on the same version are tolerated, and
# the "version" lifecycle script (standard-version) is skipped.
npm version "${{ github.event.release.tag_name }}" --no-git-tag-version --allow-same-version --ignore-scripts
# Fail fast if the bump ever corrupts the scripts.version lifecycle hook again (the original #89 bug).
node -e "if (require('./package.json').scripts.version !== 'standard-version') { console.error('scripts.version was corrupted by the version bump'); process.exit(1); }"

- name: Publish package to NPM
run: |
if [[ "${{ github.event.release.prerelease }}" == "true" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"cov:check": "nyc report && nyc check-coverage --lines 100 --functions 100 --branches 100",
"docs": "typedoc",
"docs:watch": "typedoc --watch",
"version": "2.5.2",
"version": "standard-version",
"reset-hard": "git clean -dfx && git reset --hard && yarn",
"prepare": "npm run build && husky install",
"prepare-release": "run-s reset-hard test cov:check doc:html version doc:publish",
Expand Down