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