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