UNPKG

1.84 kBapplication/x-shView Raw
1#!/bin/bash
2
3echo "Publish master or stable?"
4select branch in "master" "stable"; do
5 read -p "You selected $branch. [Enter] to continue"
6 git checkout $branch
7
8 git pull upstream $branch
9
10 read -p "Just pulled $branch from upstream. If everything is okay, hit [Enter]"
11
12 echo "Clear node_modules?"
13 select yn in "Yes" "No"; do
14 case $yn in
15 Yes) rm -rf node_modules/; npm i; break;;
16 No) echo "Skipped clearing node_modules"; break;;
17 esac
18 done
19
20 if [ $branch = "master" ]; then
21 echo "You cannot publish master from this script at this time. To continue, publish manually from this point."
22 exit 1
23 fi
24
25 echo "What type of publish?"
26 select version_type in "patch" "minor" "major"; do
27 read -p "Creating commit and tag for a $version_type release. Press [Enter].";
28
29 # Use npm to increment the version and capture it
30 version_with_v=`npm version $version_type`
31
32 # Remove the "v" from v8.8.8 to get 8.8.8
33 version=`echo $version_with_v | cut -b 2-`
34
35 # Remove npm's v8.8.8 tag and replace it with 8.8.8
36 # because that's what we've always done
37 git tag -d $version_with_v
38
39 echo "Deleted tag because it's wrong, no worries, we'll tag again in a sec"
40
41 echo "Generating CHANGELOG.md"
42 npm run generate_changelog
43
44 # Quickly show changes to verify
45 git diff
46 read -p "Examine and correct CHANGELOG.md. [Enter] to continue"
47
48 git tag $version
49
50
51 read -p "git tag updated to $version; [Enter] to continue";
52 break
53 done
54
55
56 read -p "Ready to publish @reactivex/rxjs@$version. [Enter] to continue"
57 npm publish
58
59 read -p "Ready to publish rxjs@$version. [Enter] to continue"
60 cd dist/package/
61 npm publish
62 cd ../../
63
64 read -p "Ready to push $branch to upstream. [Enter] to continue"
65 git push upstream $branch
66 git push upstream --tags
67
68 break
69done