Skip to content

Commit

Permalink
fix(changelog): include latest changelog in npm packages
Browse files Browse the repository at this point in the history
  • Loading branch information
trxcllnt committed Jul 10, 2024
1 parent c68e97c commit f25687b
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions npm-release.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
#! /usr/bin/env bash

set -x;

bump=${1:?missing required semantic-version bump. usage: \`$0 major|minor|patch\`}
echo "semantic-version bump: $bump"

cp {,_}package.json
npm --no-git-tag-version version "$bump" &>/dev/null
npx conventional-changelog -i CHANGELOG.md -s -p angular

npm run --silent lint
npm run --silent build
npm run --silent test
npx lerna version \
--yes --force-publish=* \
--no-push --no-git-tag-version \
$bump
"$bump"

cp package.json _package.json
npm --no-git-tag-version version $bump &>/dev/null
npx conventional-changelog -i CHANGELOG.md -s -p angular
git add CHANGELOG.md lerna.json
version=$(npx --yes json -f package.json version)
git commit -m "docs(CHANGELOG): $version" -n
mv -f _package.json package.json
npm version $bump -m "chore(release): %s"
git commit -m "docs(CHANGELOG): $(npx --yes json -f package.json version)" -n
mv -f {_,}package.json
npm version "$bump" -m "chore(release): %s"
git push --follow-tags
npx conventional-github-releaser -p angular

read -p "Please enter your npm 2FA one-time password: " NPM_OTP </dev/tty

npx lerna exec --concurrency 1 --no-bail -- npm publish --otp=$NPM_OTP
npx lerna exec --concurrency 1 --no-bail -- npm publish --otp="$NPM_OTP"

0 comments on commit f25687b

Please sign in to comment.