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