summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Driessen <me@nvie.com>2016-04-24 17:07:41 +0200
committerVincent Driessen <me@nvie.com>2016-04-24 17:07:41 +0200
commit05c468eaec0be6ed5a1beae9d70f51655dfba770 (patch)
tree9ecce0616acbb58708466fa921b1fa2bf41ddef8
parentbc505ddd603b1570c2c1acc224698e1421ca8a6d (diff)
downloadgitpython-05c468eaec0be6ed5a1beae9d70f51655dfba770.tar.gz
Automate steps to upload to PyPI
-rw-r--r--Makefile19
-rw-r--r--README.md32
2 files changed, 27 insertions, 24 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 00000000..38564f97
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,19 @@
+all:
+ @grep -Ee '^[a-z].*:' Makefile | cut -d: -f1 | grep -vF all
+
+clean:
+ rm -rf build/ dist/
+
+release: clean
+ # Check if latest tag is the current head we're releasing
+ echo "Latest tag = $$(git tag | sort -nr | head -n1)"
+ echo "HEAD SHA = $$(git rev-parse head)"
+ echo "Latest tag SHA = $$(git tag | sort -nr | head -n1 | xargs git rev-parse)"
+ @test "$$(git rev-parse head)" = "$$(git tag | sort -nr | head -n1 | xargs git rev-parse)"
+ make force_release
+
+force_release: clean
+ @which -s twine || echo "Twine not installed, run pip install twine first"
+ git push --tags
+ python setup.py sdist bdist_wheel
+ twine upload dist/*
diff --git a/README.md b/README.md
index a0638028..220e8f35 100644
--- a/README.md
+++ b/README.md
@@ -70,31 +70,15 @@ You can watch me fix issues or implement new features [live on Twitch][twitch-ch
### How to make a new release
-* assure `changes.rst` is up-to-date
-* put new version into `VERSION` file
-* run `./setup.py sdist`
-* On https://pypi.python.org
- - Click `GitPython` (and pray it will not timeout)
- - Lucky ? Click `edit` on the last version, and copy the main description text
- to your clipboard - it's needed later.
- - On top of that page, click the `PKG file` button or drag & drop the one from
- `./GitPython.egg-info/PKG-INFO` on it. Then click the `add ...` button to
- create a new version.
- - Paste the previously copied description text into the description field, and click the `add information` button on the very bottom of the page.
- - Click `GitPython` again and then click `files` of the newly created version.
- - Select `source package` in the dropdown, then choose or drag & drop
- `./dist/GitPython-<version>.tar.gz` onto the file path.
- - Click the `upload` button.
-* Run `git tag <version>` to mark the version you just uploaded to pypi.
-* Run `git push --tags origin master` to publish the changes.
-* finally, set the upcoming version in the `VERSION` file, usually be incrementing
- the patch level, and possibly by appending `-dev`. Probably you want to `git push` once more.
+* Update/verify the version in the `VERSION` file
+* Update/verify that the changelog has been updated
+* Commit everything
+* Run `git tag <version>` to tag the version in Git
+* Run `make release`
+* Finally, set the upcoming version in the `VERSION` file, usually be
+ incrementing the patch level, and possibly by appending `-dev`. Probably you
+ want to `git push` once more.
-*NOTE:* At the time of writing, pypi wouldn't hear my prayers and did timeout on
-me, which is why button names are just *guesses*. It's advised to update this text
-next time someone manages to publish a new release to a system so firmly rooted in
-the past.
-
### LICENSE
New BSD License. See the LICENSE file.