File: upload-pypi.sh

package info (click to toggle)
ceccomp 3.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,528 kB
  • sloc: ansic: 3,154; python: 653; makefile: 240; sh: 226
file content (81 lines) | stat: -rwxr-xr-x 1,561 bytes parent folder | download
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
set -e

# 通用构建函数
build_and_upload() {
    BUILD_TARGET=$1
    WHEEL_TAG=$2

    echo "===== 构建架构:($BUILD_TARGET) ====="

    ./configure \
        --debug-level=0 \
        --enable-static \
        --without-i18n \
        --without-doc \
        --packager=pip \
        --build=${BUILD_TARGET}

    make clean
    make

    mv build/ceccomp py-temp/ceccomp/
    cd py-temp

    python -m build --wheel

    oldfile=$(ls dist/ceccomp-*-py3-none-any.whl | head -n 1)
    newfile="${oldfile/any/${WHEEL_TAG}}"

    mv "$oldfile" "$newfile"
    twine upload "$newfile" --repository ceccomp

    rm -rf dist/ build/ ceccomp.egg-info/ wheelhouse/ ceccomp/ceccomp
    cd ..
}

build_x86_64() {
    build_and_upload "x86_64-linux-gnu" "manylinux1_x86_64"
}

build_i386() {
    build_and_upload "i386-linux-gnu" "manylinux1_i686"
}

build_aarch64() {
    build_and_upload "aarch64-linux-gnu" "manylinux2014_aarch64"
}

build_armhf() {
    build_and_upload "arm-linux-gnueabihf" "manylinux2014_armv7l"
}

build_riscv64() {
    build_and_upload "riscv64-linux-gnu" "manylinux_2_31_riscv64"
}


# 根据参数选择执行
case "$1" in
    x86_64)
        build_x86_64;;
    i386)
        build_i386;;
    aarch64)
        build_aarch64;;
    armhf)
        build_armhf;;
    riscv64)
        build_riscv64;;
    all)
        build_x86_64
        build_i386
        build_aarch64
        build_armhf
        build_riscv64
        ;;
    *)
        echo "用法: $0 {x86_64|i386|aarch64|armhf|riscv64|all}"
        exit 1
        ;;
esac