Alex Gaynor | 0e10f57 | 2014-01-06 13:17:31 -0800 | [diff] [blame] | 1 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 2 | # you may not use this file except in compliance with the License. |
| 3 | # You may obtain a copy of the License at |
| 4 | # |
| 5 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | # |
| 7 | # Unless required by applicable law or agreed to in writing, software |
| 8 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| 10 | # implied. |
| 11 | # See the License for the specific language governing permissions and |
| 12 | # limitations under the License. |
| 13 | from __future__ import absolute_import, division, print_function |
| 14 | |
Alex Gaynor | 6bc3af7 | 2014-01-06 12:04:53 -0800 | [diff] [blame] | 15 | import invoke |
| 16 | |
| 17 | |
Alex Gaynor | 6bc3af7 | 2014-01-06 12:04:53 -0800 | [diff] [blame] | 18 | @invoke.task |
| 19 | def release(version): |
| 20 | """ |
| 21 | ``version`` should be a string like '0.4' or '1.0'. |
| 22 | """ |
Alex Gaynor | 6bc3af7 | 2014-01-06 12:04:53 -0800 | [diff] [blame] | 23 | invoke.run("git tag -s {}".format(version)) |
Alex Gaynor | 6b1235a | 2014-01-06 15:28:59 -0800 | [diff] [blame] | 24 | invoke.run("git push --tags") |
Alex Gaynor | 6bc3af7 | 2014-01-06 12:04:53 -0800 | [diff] [blame] | 25 | |
Alex Gaynor | fea893c | 2014-01-07 11:06:51 -0800 | [diff] [blame^] | 26 | invoke.run("python setup.py sdist") |
Alex Gaynor | 6bc3af7 | 2014-01-06 12:04:53 -0800 | [diff] [blame] | 27 | invoke.run("twine upload -s dist/cryptography-{}*".format(version)) |