-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(scripts): add guided publish script
- Loading branch information
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/bin/bash | ||
|
||
echo "Publish master or stable?" | ||
select branch in "master" "stable"; do | ||
|
||
read -p "You selected $branch. [Enter] to continue" | ||
git checkout $branch | ||
|
||
git pull upstream $branch | ||
|
||
read -p "Just pulled $branch from upstream. If everything is okay, hit [Enter]" | ||
|
||
echo "Clear node_modules?" | ||
select yn in "Yes" "No"; do | ||
case $yn in | ||
Yes) rm -rf node_modules/; npm i; break;; | ||
No) echo "Skipped clearing node_modules"; break;; | ||
esac | ||
done | ||
|
||
echo "What type of publish?" | ||
select version_type in "patch" "minor" "major"; do | ||
read -p "Creating commit and tag for a $version_type release. Press [Enter]."; | ||
|
||
# Use npm to increment the version and capture it | ||
version_with_v=`npm version $version_type` | ||
|
||
# Remove the "v" from v8.8.8 to get 8.8.8 | ||
version=`echo $version_with_v | cut -b 2-` | ||
|
||
# Remove npm's v8.8.8 tag and replace it with 8.8.8 | ||
# because that's what we've always done | ||
git tag -d $version_with_v | ||
|
||
echo "Deleted tag because it's wrong, no worries, we'll tag again in a sec" | ||
|
||
echo "Generating CHANGELOG.md" | ||
npm run generate_changelog | ||
|
||
# Quickly show changes to verify | ||
git diff | ||
read -p "Examine and correct CHANGELOG.md. [Enter] to continue" | ||
|
||
git tag $version | ||
|
||
|
||
read -p "git tag updated to $version; [Enter] to continue"; | ||
break | ||
done | ||
|
||
|
||
read -p "Ready to publish @reactivex/rxjs@$version. [Enter] to continue" | ||
npm publish | ||
|
||
read -p "Ready to publish rxjs@$version. [Enter] to continue" | ||
cd dist/package/ | ||
npm publish | ||
cd ../../ | ||
|
||
read -p "Ready to push $branch to upstream. [Enter] to continue" | ||
git push upstream $branch | ||
git push upstream --tags | ||
|
||
break | ||
done |