Skip to content

Commit

Permalink
chore(scripts): add guided publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
benlesh committed Dec 6, 2017
1 parent 4b3f06b commit efcd922
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions publish.sh
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

0 comments on commit efcd922

Please sign in to comment.