##// END OF EJS Templates
Update release script to use git switch in place of checkout
Samuel Gaist -
Show More
@@ -1,5 +1,5 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 BLACK=$(tput setaf 1)
5 BLACK=$(tput setaf 1)
@@ -62,7 +62,7 b' ask_section(){'
62
62
63 maybe_edit(){
63 maybe_edit(){
64 echo
64 echo
65 echo $BLUE"$1"$NOR
65 echo $BLUE"$1"$NOR
66 echo -n $GREEN"Press ${BLUE}e$GREEN to Edit ${BLUE}$1$GREEN, any other keys to skip: "$NOR
66 echo -n $GREEN"Press ${BLUE}e$GREEN to Edit ${BLUE}$1$GREEN, any other keys to skip: "$NOR
67 if [ "$ZSH_NAME" = "zsh" ] ; then
67 if [ "$ZSH_NAME" = "zsh" ] ; then
68 read -k1 value
68 read -k1 value
@@ -71,7 +71,7 b' maybe_edit(){'
71 read -n1 value
71 read -n1 value
72 fi
72 fi
73
73
74 echo
74 echo
75 if [ $value = 'e' ] ; then
75 if [ $value = 'e' ] ; then
76 $=EDITOR $1
76 $=EDITOR $1
77 fi
77 fi
@@ -79,7 +79,7 b' maybe_edit(){'
79
79
80
80
81
81
82 echo
82 echo
83 if ask_section "Updating what's new with information from docs/source/whatsnew/pr"
83 if ask_section "Updating what's new with information from docs/source/whatsnew/pr"
84 then
84 then
85 python tools/update_whatsnew.py
85 python tools/update_whatsnew.py
@@ -93,11 +93,11 b' fi'
93 if ask_section "Gen Stats, and authors"
93 if ask_section "Gen Stats, and authors"
94 then
94 then
95
95
96 echo
96 echo
97 echo $BLUE"here are all the authors that contributed to this release:"$NOR
97 echo $BLUE"here are all the authors that contributed to this release:"$NOR
98 git log --format="%aN <%aE>" $PREV_RELEASE... | sort -u -f
98 git log --format="%aN <%aE>" $PREV_RELEASE... | sort -u -f
99
99
100 echo
100 echo
101 echo $BLUE"If you see any duplicates cancel (Ctrl-C), then edit .mailmap."
101 echo $BLUE"If you see any duplicates cancel (Ctrl-C), then edit .mailmap."
102 echo $GREEN"Press enter to continue:"$NOR
102 echo $GREEN"Press enter to continue:"$NOR
103 read
103 read
@@ -115,12 +115,12 b' fi'
115 if ask_section "Generate API difference (using frapuccino)"
115 if ask_section "Generate API difference (using frapuccino)"
116 then
116 then
117 echo $BLUE"Checking out $PREV_RELEASE"$NOR
117 echo $BLUE"Checking out $PREV_RELEASE"$NOR
118 git checkout $PREV_RELEASE
118 git switch $PREV_RELEASE
119 sleep 1
119 sleep 1
120 echo $BLUE"Saving API to file $PREV_RELEASE"$NOR
120 echo $BLUE"Saving API to file $PREV_RELEASE"$NOR
121 frappuccino IPython IPython.kernel IPython.lib IPython.qt IPython.lib.kernel IPython.html IPython.frontend IPython.external --save IPython-$PREV_RELEASE.json
121 frappuccino IPython IPython.kernel IPython.lib IPython.qt IPython.lib.kernel IPython.html IPython.frontend IPython.external --save IPython-$PREV_RELEASE.json
122 echo $BLUE"coming back to $BRANCH"$NOR
122 echo $BLUE"coming back to $BRANCH"$NOR
123 git checkout $BRANCH
123 git switch $BRANCH
124 sleep 1
124 sleep 1
125 echo $BLUE"comparing ..."$NOR
125 echo $BLUE"comparing ..."$NOR
126 frappuccino IPython IPython.kernel IPython.lib --compare IPython-$PREV_RELEASE.json
126 frappuccino IPython IPython.kernel IPython.lib --compare IPython-$PREV_RELEASE.json
@@ -145,7 +145,7 b' read'
145 if ask_section "Build the documentation ?"
145 if ask_section "Build the documentation ?"
146 then
146 then
147 make html -C docs
147 make html -C docs
148 echo
148 echo
149 echo $GREEN"Check the docs, press enter to continue"$NOR
149 echo $GREEN"Check the docs, press enter to continue"$NOR
150 read
150 read
151
151
@@ -158,27 +158,27 b' then'
158 echo $GREEN"Press enter to commit"$NOR
158 echo $GREEN"Press enter to commit"$NOR
159 read
159 read
160 git commit -am "release $VERSION" -S
160 git commit -am "release $VERSION" -S
161
161
162 echo
162 echo
163 echo $BLUE"git push origin \$BRANCH ($BRANCH)?"$NOR
163 echo $BLUE"git push origin \$BRANCH ($BRANCH)?"$NOR
164 echo $GREEN"Make sure you can push"$NOR
164 echo $GREEN"Make sure you can push"$NOR
165 echo $GREEN"Press enter to continue"$NOR
165 echo $GREEN"Press enter to continue"$NOR
166 read
166 read
167 git push origin $BRANCH
167 git push origin $BRANCH
168
168
169 echo
169 echo
170 echo "Let's tag : git tag -am \"release $VERSION\" \"$VERSION\" -s"
170 echo "Let's tag : git tag -am \"release $VERSION\" \"$VERSION\" -s"
171 echo $GREEN"Press enter to tag commit"$NOR
171 echo $GREEN"Press enter to tag commit"$NOR
172 read
172 read
173 git tag -am "release $VERSION" "$VERSION" -s
173 git tag -am "release $VERSION" "$VERSION" -s
174
174
175 echo
175 echo
176 echo $BLUE"And push the tag: git push origin \$VERSION ?"$NOR
176 echo $BLUE"And push the tag: git push origin \$VERSION ?"$NOR
177 echo $GREEN"Press enter to continue"$NOR
177 echo $GREEN"Press enter to continue"$NOR
178 read
178 read
179 git push origin $VERSION
179 git push origin $VERSION
180
180
181
181
182 echo $GREEN"please update version number and back to .dev in ${RED}IPython/core/release.py"
182 echo $GREEN"please update version number and back to .dev in ${RED}IPython/core/release.py"
183 echo $GREEN"I tried ${RED}sed -i bkp -e '/Uncomment/s/^/# /g' IPython/core/release.py${NOR}"
183 echo $GREEN"I tried ${RED}sed -i bkp -e '/Uncomment/s/^/# /g' IPython/core/release.py${NOR}"
184 sed -i bkp -e '/Uncomment/s/^/# /g' IPython/core/release.py
184 sed -i bkp -e '/Uncomment/s/^/# /g' IPython/core/release.py
@@ -188,10 +188,10 b' then'
188 maybe_edit IPython/core/release.py
188 maybe_edit IPython/core/release.py
189 echo ${BLUE}"Do not commit yet – we'll do it later."$NOR
189 echo ${BLUE}"Do not commit yet – we'll do it later."$NOR
190
190
191
191
192 echo $GREEN"Press enter to continue"$NOR
192 echo $GREEN"Press enter to continue"$NOR
193 read
193 read
194
194
195 echo
195 echo
196 echo "Let's commit : "$BLUE"git commit -am \"back to dev\""$NOR
196 echo "Let's commit : "$BLUE"git commit -am \"back to dev\""$NOR
197 echo $GREEN"Press enter to commit"$NOR
197 echo $GREEN"Press enter to commit"$NOR
@@ -204,17 +204,17 b' then'
204 read
204 read
205 git push origin $BRANCH
205 git push origin $BRANCH
206
206
207
207
208 echo
208 echo
209 echo $BLUE"let's : git checkout $VERSION"$NOR
209 echo $BLUE"let's : git switch $VERSION"$NOR
210 echo $GREEN"Press enter to continue"$NOR
210 echo $GREEN"Press enter to continue"$NOR
211 read
211 read
212 git checkout $VERSION
212 git switch $VERSION
213 fi
213 fi
214
214
215 if ask_section "Should we build and release ?"
215 if ask_section "Should we build and release ?"
216 then
216 then
217
217
218 echo $BLUE"going to set SOURCE_DATE_EPOCH"$NOR
218 echo $BLUE"going to set SOURCE_DATE_EPOCH"$NOR
219 echo $BLUE'export SOURCE_DATE_EPOCH=$(git show -s --format=%ct HEAD)'$NOR
219 echo $BLUE'export SOURCE_DATE_EPOCH=$(git show -s --format=%ct HEAD)'$NOR
220 echo $GREEN"Press enter to continue"$NOR
220 echo $GREEN"Press enter to continue"$NOR
@@ -253,7 +253,7 b' then'
253 echo $NOR
253 echo $NOR
254
254
255 if ask_section "upload packages ?"
255 if ask_section "upload packages ?"
256 then
256 then
257 tools/release upload
257 tools/release upload
258 fi
258 fi
259 fi
259 fi
General Comments 0
You need to be logged in to leave comments. Login now