summaryrefslogtreecommitdiff
path: root/.ci/travis-release.sh
blob: 664708b0d415e82ef6dc337696f64cc0dfa99b92 (about) (plain)
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
#!/bin/bash

set -e -x


if [ -z "${TRAVIS_TAG}" ]; then
    # Not a release
    exit 0
fi


PACKAGE_VERSION=$(python ".ci/package-version.py")
PYPI_VERSION=$(python ".ci/pypi-check.py" "${PYMODULE}")

if [ "${PACKAGE_VERSION}" == "${PYPI_VERSION}" ]; then
    echo "${PYMODULE}-${PACKAGE_VERSION} is already published on PyPI"
    exit 0
fi

# Check if all expected wheels have been built and uploaded.
release_platforms=(
    "macosx_10_??_x86_64"
    "manylinux1_i686"
    "manylinux1_x86_64"
    "win32"
    "win_amd64"
)

P="${PYMODULE}-${PACKAGE_VERSION}"
expected_wheels=()

for pyver in ${RELEASE_PYTHON_VERSIONS}; do
    abitag=$(python -c \
        "print('cp{maj}{min}-cp{maj}{min}{s}'.format( \
                maj='${pyver}'.split('.')[0], \
                min='${pyver}'.split('.')[1],
                s='m' if tuple('${pyver}'.split('.')) < ('3', '8') else ''))")
    for plat in "${release_platforms[@]}"; do
        expected_wheels+=("${P}-${abitag}-${plat}.whl")
    done
done

rm -rf dist/*.whl dist/*.tar.*
python setup.py sdist
python ".ci/s3-download-release.py" --destdir=dist/ "${P}"

_file_exists() { [[ -f $1 ]]; }

for distfile in "${expected_wheels[@]}"; do
    if ! _file_exists dist/${distfile}; then
        echo "Expected wheel ${distfile} not found."
        exit 1
    fi
done

python -m twine upload dist/*.whl dist/*.tar.*
class='nohover-highlight'> * .guix-authorizations (jpoiret): Add OpenPGP key fingerprint. 2023-05-11.guix-authorizations: Authorize Simon Tournier.Maxim Cournoyer * .guix-authorizations (zimoun): Add OpenPGP key fingerprint. 2023-03-24.guix-authorizations: Remove Paul Garlick due to inactivity.Leo Famulari * .guix-authorizations: Remove from pgarlick. 2023-03-24.guix-authorizations: Remove Jakub Kądziołka due to inactivity.Leo Famulari * .guix-authorizations: Remove niedzejkob. 2023-03-24.guix-authorizations: Remove Chris Marusich due to inactivity.Leo Famulari * .guix-authorizations: Remove marusich. 2023-03-24.guix-authorizations: Remove Brice Waegeneire due to inactivity.Leo Famulari * .guix-authorizations: Remove bricewge. 2023-03-24.guix-authorizations: Remove Alex Kost due to inactivity.Leo Famulari * .guix-authorizations: Remove alezost. 2022-12-11.guix-authorizations: Authorise John Kehayias.Tobias Geerinckx-Rice * .guix-authorizations (podiki): Add OpenPGP key fingerprint. 2022-11-08authorizations: Remove old key for "davexunit".David Thompson * .guix-authorizations ("davexunit"): Remove. ("davexunit (2nd)"): Rename to "dthompson". 2022-08-11.guix-authorizations: Authorize Andrew Tropin's subkey instead.Tobias Geerinckx-Rice Addresses <https://issues.guix.gnu.org/57091> for now. * .guix-authorizations (abcdw): Use signing subkey instead of primary. 2022-08-05.git-authorizations: Authorize Andrew Tropin.Efraim Flashner * .git-authorizations (abcdw): Add OpenPGP key fingerprint.