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