-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·62 lines (41 loc) · 1.15 KB
/
build.sh
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
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
set -e
# Requirements (Fedora)
# sudo dnf install python3-virtualenv
HERE=$(dirname "$(readlink --canonicalize "$BASH_SOURCE")")
cd "$HERE"
VERSION=$(git describe --tags --always)
echo "__version__ = '$VERSION'" > "$HERE/ard/version.py"
rm --force --recursive dist
mkdir --parents dist
rm --recursive --force dist/env
python3 -m venv --upgrade-deps dist/env
. dist/env/bin/activate
python -m pip install wheel
if [ "$1" == -e ]; then
# Install editable
python -m pip install --editable .
else
# Build
./setup.py sdist bdist_wheel
SDIST=dist/ard-$VERSION.tar.gz
BDIST=dist/ard-$VERSION-py3-none-any.whl
if [ "$1" == -s ]; then
# Install sdist
python -m pip install "$SDIST"
elif [ "$1" == -b ]; then
# Install bdist
python -m pip install "$BDIST"
elif [ "$1" == -p ]; then
# Publish
python -m pip install twine
gpg --detach-sign --armor --yes "$SDIST"
gpg --detach-sign --armor --yes "$BDIST"
# Upload to PyPI
twine upload \
"$SDIST" \
"$SDIST.asc" \
"$BDIST" \
"$BDIST.asc"
fi
fi