##// END OF EJS Templates
try to auto comment ''/.dev
Matthias Bussonnier -
Show More
@@ -1,214 +1,224 b''
1 # Simple tool to help for release
1 # Simple tool to help for release
2 # when releasing with bash, simple source it to get asked questions.
2 # when releasing with bash, simple source it to get asked questions.
3
3
4 # misc check before starting
4 # misc check before starting
5
5
6 python -c 'import keyring'
6 python -c 'import keyring'
7 python -c 'import twine'
7 python -c 'import twine'
8 python -c 'import sphinx'
8 python -c 'import sphinx'
9 python -c 'import sphinx_rtd_theme'
9 python -c 'import sphinx_rtd_theme'
10 python -c 'import nose'
10 python -c 'import nose'
11
11
12
12
13 BLACK=$(tput setaf 1)
13 BLACK=$(tput setaf 1)
14 RED=$(tput setaf 1)
14 RED=$(tput setaf 1)
15 GREEN=$(tput setaf 2)
15 GREEN=$(tput setaf 2)
16 YELLOW=$(tput setaf 3)
16 YELLOW=$(tput setaf 3)
17 BLUE=$(tput setaf 4)
17 BLUE=$(tput setaf 4)
18 MAGENTA=$(tput setaf 5)
18 MAGENTA=$(tput setaf 5)
19 CYAN=$(tput setaf 6)
19 CYAN=$(tput setaf 6)
20 WHITE=$(tput setaf 7)
20 WHITE=$(tput setaf 7)
21 NOR=$(tput sgr0)
21 NOR=$(tput sgr0)
22
22
23
23
24 echo -n "PREV_RELEASE (X.y.z) [$PREV_RELEASE]: "
24 echo -n "PREV_RELEASE (X.y.z) [$PREV_RELEASE]: "
25 read input
25 read input
26 PREV_RELEASE=${input:-$PREV_RELEASE}
26 PREV_RELEASE=${input:-$PREV_RELEASE}
27 echo -n "MILESTONE (X.y) [$MILESTONE]: "
27 echo -n "MILESTONE (X.y) [$MILESTONE]: "
28 read input
28 read input
29 MILESTONE=${input:-$MILESTONE}
29 MILESTONE=${input:-$MILESTONE}
30 echo -n "VERSION (X.y.z) [$VERSION]:"
30 echo -n "VERSION (X.y.z) [$VERSION]:"
31 read input
31 read input
32 VERSION=${input:-$VERSION}
32 VERSION=${input:-$VERSION}
33 echo -n "BRANCH (master|X.y) [$BRANCH]:"
33 echo -n "BRANCH (master|X.y) [$BRANCH]:"
34 read input
34 read input
35 BRANCH=${input:-$BRANCH}
35 BRANCH=${input:-$BRANCH}
36
36
37 ask_section(){
37 ask_section(){
38 echo
38 echo
39 echo $BLUE"$1"$NOR
39 echo $BLUE"$1"$NOR
40 echo -n $GREEN"Press Enter to continue, S to skip: "$NOR
40 echo -n $GREEN"Press Enter to continue, S to skip: "$NOR
41 read -n1 value
41 read -n1 value
42 echo
42 echo
43 if [ -z $value ] || [ $value = 'y' ] ; then
43 if [ -z $value ] || [ $value = 'y' ] ; then
44 return 0
44 return 0
45 fi
45 fi
46 return 1
46 return 1
47 }
47 }
48
48
49
49
50
50
51 echo
51 echo
52 if ask_section "Updating what's new with informations from docs/source/whatsnew/pr"
52 if ask_section "Updating what's new with informations from docs/source/whatsnew/pr"
53 then
53 then
54 python tools/update_whatsnew.py
54 python tools/update_whatsnew.py
55
55
56 echo
56 echo
57 echo $BLUE"please move the contents of "docs/source/whatsnew/development.rst" to version-X.rst"$NOR
57 echo $BLUE"please move the contents of "docs/source/whatsnew/development.rst" to version-X.rst"$NOR
58 echo $GREEN"Press enter to continue"$NOR
58 echo $GREEN"Press enter to continue"$NOR
59 read
59 read
60 fi
60 fi
61
61
62 if ask_section "Gen Stats, and authors"
62 if ask_section "Gen Stats, and authors"
63 then
63 then
64
64
65 echo
65 echo
66 echo $BLUE"here are all the authors that contributed to this release:"$NOR
66 echo $BLUE"here are all the authors that contributed to this release:"$NOR
67 git log --format="%aN <%aE>" $PREV_RELEASE... | sort -u -f
67 git log --format="%aN <%aE>" $PREV_RELEASE... | sort -u -f
68
68
69 echo
69 echo
70 echo $BLUE"If you see any duplicates cancel (Ctrl-C), then edit .mailmap."
70 echo $BLUE"If you see any duplicates cancel (Ctrl-C), then edit .mailmap."
71 echo $GREEN"Press enter to continue:"$NOR
71 echo $GREEN"Press enter to continue:"$NOR
72 read
72 read
73
73
74 echo $BLUE"generating stats"$NOR
74 echo $BLUE"generating stats"$NOR
75 python tools/github_stats.py --milestone $MILESTONE > stats.rst
75 python tools/github_stats.py --milestone $MILESTONE > stats.rst
76
76
77 echo $BLUE"stats.rst files generated."$NOR
77 echo $BLUE"stats.rst files generated."$NOR
78 echo $GREEN"Please merge it with the right file (github-stats-X.rst) and commit."$NOR
78 echo $GREEN"Please merge it with the right file (github-stats-X.rst) and commit."$NOR
79 echo $GREEN"press enter to continue."$NOR
79 echo $GREEN"press enter to continue."$NOR
80 read
80 read
81
81
82 fi
82 fi
83
83
84 if ask_section "Generate API difference (using frapuccino)"
84 if ask_section "Generate API difference (using frapuccino)"
85 then
85 then
86 echo $BLUE"Checking out $PREV_RELEASE"$NOR
86 echo $BLUE"Checking out $PREV_RELEASE"$NOR
87 git checkout $PREV_RELEASE
87 git checkout $PREV_RELEASE
88 echo $BLUE"Saving API to file $PREV_RELEASE"$NOR
88 echo $BLUE"Saving API to file $PREV_RELEASE"$NOR
89 frappuccino IPython --save IPython-$PREV_RELEASE.json
89 frappuccino IPython --save IPython-$PREV_RELEASE.json
90 echo $BLUE"comming back to $BRANCH"$NOR
90 echo $BLUE"comming back to $BRANCH"$NOR
91 git checkout $BRANCH
91 git checkout $BRANCH
92 echo $BLUE"comparing ..."$NOR
92 echo $BLUE"comparing ..."$NOR
93 frappuccino IPython --compare IPython-$PREV_RELEASE.json
93 frappuccino IPython --compare IPython-$PREV_RELEASE.json
94 echo $GREEN"Use the above guideline to write an API changelog ..."$NOR
94 echo $GREEN"Use the above guideline to write an API changelog ..."$NOR
95 echo $GREEN"Press any keys to continue"$NOR
95 echo $GREEN"Press any keys to continue"$NOR
96 read
96 read
97 fi
97 fi
98
98
99 echo "Cleaning repository"
99 echo "Cleaning repository"
100 git clean -xfdi
100 git clean -xfdi
101
101
102 echo $GREEN"please update version number in ${RED}IPython/core/release.py${NOR} , Do not commit yet – we'll do it later."$NOR
102 echo $GREEN"please update version number in ${RED}IPython/core/release.py${NOR} , Do not commit yet – we'll do it later."$NOR
103 echo $GREEN"I tried ${RED}sed -i bkp -e '/Uncomment/s/^# //g' IPython/core/release.py${NOR}"
104 sed -i bkp -e '/Uncomment/s/^# //g' IPython/core/release.py
105 rm IPython/core/release.pybkp
106 git diff
103
107
104 echo $GREEN"Press enter to continue"$NOR
108 echo $GREEN"Press enter to continue"$NOR
105 read
109 read
106
110
107 if ask_section "Build the documentation ?"
111 if ask_section "Build the documentation ?"
108 then
112 then
109 make html -C docs
113 make html -C docs
110 echo
114 echo
111 echo $GREEN"Check the docs, press enter to continue"$NOR
115 echo $GREEN"Check the docs, press enter to continue"$NOR
112 read
116 read
113
117
114 fi
118 fi
115
119
116 if ask_section "Should we commit, tag, push... etc ? "
120 if ask_section "Should we commit, tag, push... etc ? "
117 then
121 then
118 echo
122 echo
119 echo $BLUE"Let's commit : git commit -am \"release $VERSION\" -S"
123 echo $BLUE"Let's commit : git commit -am \"release $VERSION\" -S"
120 echo $GREEN"Press enter to commit"$NOR
124 echo $GREEN"Press enter to commit"$NOR
121 read
125 read
122 git commit -am "release $VERSION" -S
126 git commit -am "release $VERSION" -S
123
127
124 echo
128 echo
125 echo $BLUE"git push origin \$BRANCH ($BRANCH)?"$NOR
129 echo $BLUE"git push origin \$BRANCH ($BRANCH)?"$NOR
126 echo $GREEN"Make sure you can push"$NOR
130 echo $GREEN"Make sure you can push"$NOR
127 echo $GREEN"Press enter to continue"$NOR
131 echo $GREEN"Press enter to continue"$NOR
128 read
132 read
129 git push origin $BRANCH
133 git push origin $BRANCH
130
134
131 echo
135 echo
132 echo "Let's tag : git tag -am \"release $VERSION\" \"$VERSION\" -s"
136 echo "Let's tag : git tag -am \"release $VERSION\" \"$VERSION\" -s"
133 echo $GREEN"Press enter to tag commit"$NOR
137 echo $GREEN"Press enter to tag commit"$NOR
134 read
138 read
135 git tag -am "release $VERSION" "$VERSION" -s
139 git tag -am "release $VERSION" "$VERSION" -s
136
140
137 echo
141 echo
138 echo $BLUE"And push the tag: git push origin \$VERSION ?"$NOR
142 echo $BLUE"And push the tag: git push origin \$VERSION ?"$NOR
139 echo $GREEN"Press enter to continue"$NOR
143 echo $GREEN"Press enter to continue"$NOR
140 read
144 read
141 git push origin $VERSION
145 git push origin $VERSION
142
146
143
147
144 echo $GREEN"please update version number and back to .dev in ${RED}IPython/core/release.py"
148 echo $GREEN"please update version number and back to .dev in ${RED}IPython/core/release.py"
149 echo $GREEN"I tried ${RED}sed -i bkp -e '/Uncomment/s/^/# /g' IPython/core/release.py${NOR}"
150 sed -i bkp -e '/Uncomment/s/^/# /g' IPython/core/release.py
151 rm IPython/core/release.pybkp
152 git diff
153 echo $GREEN"Please bump ${RED}the minor version number${NOR}"
145 echo ${BLUE}"Do not commit yet – we'll do it later."$NOR
154 echo ${BLUE}"Do not commit yet – we'll do it later."$NOR
146
155
156
147 echo $GREEN"Press enter to continue"$NOR
157 echo $GREEN"Press enter to continue"$NOR
148 read
158 read
149
159
150 echo
160 echo
151 echo "Let's commit : "$BLUE"git commit -am \"back to dev\""$NOR
161 echo "Let's commit : "$BLUE"git commit -am \"back to dev\""$NOR
152 echo $GREEN"Press enter to commit"$NOR
162 echo $GREEN"Press enter to commit"$NOR
153 read
163 read
154 git commit -am "back to dev"
164 git commit -am "back to dev"
155
165
156 echo
166 echo
157 echo $BLUE"git push origin \$BRANCH ($BRANCH)?"$NOR
167 echo $BLUE"git push origin \$BRANCH ($BRANCH)?"$NOR
158 echo $GREEN"Press enter to continue"$NOR
168 echo $GREEN"Press enter to continue"$NOR
159 read
169 read
160 git push origin $BRANCH
170 git push origin $BRANCH
161
171
162
172
163 echo
173 echo
164 echo $BLUE"let's : git checkout $VERSION"$NOR
174 echo $BLUE"let's : git checkout $VERSION"$NOR
165 echo $GREEN"Press enter to continue"$NOR
175 echo $GREEN"Press enter to continue"$NOR
166 read
176 read
167 git checkout $VERSION
177 git checkout $VERSION
168 fi
178 fi
169
179
170 if ask_section "Should we build and release ?"
180 if ask_section "Should we build and release ?"
171 then
181 then
172
182
173 echo $BLUE"going to set SOURCE_DATE_EPOCH"$NOR
183 echo $BLUE"going to set SOURCE_DATE_EPOCH"$NOR
174 echo $BLUE'export SOURCE_DATE_EPOCH=$(git show -s --format=%ct HEAD)'$NOR
184 echo $BLUE'export SOURCE_DATE_EPOCH=$(git show -s --format=%ct HEAD)'$NOR
175 echo $GREEN"Press enter to continue"$NOR
185 echo $GREEN"Press enter to continue"$NOR
176 read
186 read
177
187
178 export SOURCE_DATE_EPOCH=$(git show -s --format=%ct HEAD)
188 export SOURCE_DATE_EPOCH=$(git show -s --format=%ct HEAD)
179
189
180 echo $BLUE"SOURCE_DATE_EPOCH set to $SOURCE_DATE_EPOCH"$NOR
190 echo $BLUE"SOURCE_DATE_EPOCH set to $SOURCE_DATE_EPOCH"$NOR
181 echo $GREEN"Press enter to continue"$NOR
191 echo $GREEN"Press enter to continue"$NOR
182 read
192 read
183
193
184
194
185
195
186 echo
196 echo
187 echo $BLUE"Attempting to build package..."$NOR
197 echo $BLUE"Attempting to build package..."$NOR
188
198
189 tools/release
199 tools/release
190
200
191
201
192 echo $RED'$ shasum -a 256 dist/*'
202 echo $RED'$ shasum -a 256 dist/*'
193 shasum -a 256 dist/*
203 shasum -a 256 dist/*
194 echo $NOR
204 echo $NOR
195
205
196 echo $BLUE"We are going to rebuild, node the hash above, and compare them to the rebuild"$NOR
206 echo $BLUE"We are going to rebuild, node the hash above, and compare them to the rebuild"$NOR
197 echo $GREEN"Press enter to continue"$NOR
207 echo $GREEN"Press enter to continue"$NOR
198 read
208 read
199
209
200 echo
210 echo
201 echo $BLUE"Attempting to build package..."$NOR
211 echo $BLUE"Attempting to build package..."$NOR
202
212
203 tools/release
213 tools/release
204
214
205 echo $RED"Check the shasum for SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH"
215 echo $RED"Check the shasum for SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH"
206 echo $RED'$ shasum -a 256 dist/*'
216 echo $RED'$ shasum -a 256 dist/*'
207 shasum -a 256 dist/*
217 shasum -a 256 dist/*
208 echo $NOR
218 echo $NOR
209
219
210 if ask_section "upload packages ?"
220 if ask_section "upload packages ?"
211 then
221 then
212 tools/release upload
222 tools/release upload
213 fi
223 fi
214 fi
224 fi
General Comments 0
You need to be logged in to leave comments. Login now