release.sh 978 Bytes
Newer Older
aiss's avatar
aiss committed
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
41
42
43
44
45
46
47
48
49
#!/bin/bash

cd ..

if [ ! -f ~/.pypirc ]; then
    echo 'create .pypirc in order to upload to PyPI'
    exit 1
fi

version=$1

if [ -z $version ]; then
    echo "please provide version number for release"
    exit 1
fi

if [[ $version == *"v"* ]]; then
    echo "please only include version number without 'v' prefix"
    exit 1
fi

if [ "${version}" != `cat version.txt` ]; then
    echo "version=${version} does not match version.txt"
    cat version.txt
    exit 1
fi

python -c "import twine"
if [ $? != 0 ]; then
    echo 'please install twine via pip'
    exit 1
fi

DS_BUILD_STRING="" python setup.py sdist

if [ ! -f dist/deepspeed-${version}.tar.gz ]; then
    echo "prepared version does not match version given ($version), bump version first?"
    ls dist
    exit 1
fi

python -m twine upload dist/deepspeed-${version}.tar.gz --repository deepspeed

git tag v${version}
git push origin v${version}

echo "bumping up patch version"
cd -
python bump_patch_version.py