File: release.sh

package info (click to toggle)
python-cotyledon 1.7.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 252 kB
  • sloc: python: 1,067; sh: 34; makefile: 23
file content (40 lines) | stat: -rwxr-xr-x 844 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash

set -e
set -x

version=$1
[ ! "$version" ] && version=$(python setup.py --version | sed 's/\.dev.*//')

status=$(git status -sz)
[ -z "$status" ] || false
git checkout master
tox -epy37,py27,pep8
git push
git tag -s $version -m "Release version ${version}"
git checkout $version
git clean -fd
pbr_version=$(python setup.py --version)
if [ "$version" != "$pbr_version" ]; then
    echo "something goes wrong pbr version is different from the provided one. ($pbr_version != $version)"
    exit 1
fi
python setup.py sdist bdist_wheel

set +x
echo
echo "release: Cotyledon ${version}"
echo
echo "SHA1sum: "
sha1sum dist/*
echo "MD5sum: "
md5sum dist/*
echo
echo "uploading..."
echo
set -x

read
git push --tags
twine upload -r pypi -s dist/cotyledon-${version}.tar.gz dist/cotyledon-${version}-py2.py3-none-any.whl
git checkout master