-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish.sh
More file actions
34 lines (21 loc) · 743 Bytes
/
publish.sh
File metadata and controls
34 lines (21 loc) · 743 Bytes
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
#!/bin/bash
set -xe
cp setup.cfg setup.cfg_backup
function cleanup () {
mv setup.cfg_backup setup.cfg
}
trap cleanup ERR
# bump version
sed -r 's/version = ([0-9]+)/echo "version = $((\1+1))"/e' setup.cfg > setup.cfg_new
mv setup.cfg_new setup.cfg
VERSION=$(awk '/version = [0-9]+/ { print $3 }' setup.cfg)
SOURCEDIST=csvmodel-${VERSION}.tar.gz
BINDIST=csvmodel-${VERSION}-py3-none-any.whl
cram README.md
python -m build
twine check dist/$SOURCEDIST dist/$BINDIST
twine upload --verbose dist/$SOURCEDIST dist/$BINDIST
echo "*******************************************************"
echo "* Now commit setup.cfg and tag the commit as v${VERSION}"
echo "*******************************************************"
rm setup.cfg_backup