ref: dev mousikofidi/pypi-upload.sh -rwxr-xr-x 433 bytes View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

script_dir="$(realpath $(dirname ${0}))"

if git diff-index --quiet HEAD --; then
    if git describe --exact-match --tags HEAD -- 2>/dev/null; then
        cat <<EOF > ~/.pypirc
[pypi]
username = __token__
password = $(cat ~/.fidipypi)
EOF
        twine upload "${script_dir}"/dist/*
    else
        echo This is not a tag!  Exiting...
    exit 0
    fi
else
    echo Local changes detected!  Exiting...
    exit 0
fi