1- name : AMDSMI ManyLinux Wheels
1+ name : AMDSMI Manylinux Wheels
22
33on :
44 pull_request :
@@ -17,112 +17,88 @@ permissions:
1717 contents : read
1818
1919jobs :
20- manylinux -wheels :
21- name : Build Manylinux Wheels
20+ rpm -wheels :
21+ name : Build RPM Wheels (AlmaLinux 8 / manylinux_2_28)
2222 runs-on : ubuntu-latest
2323 container :
2424 image : quay.io/pypa/manylinux_2_28_x86_64
2525
2626 steps :
27- - uses : actions/checkout@v4
27+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
2828
2929 - name : Mark workspace safe for git
3030 run : git config --global --add safe.directory "$GITHUB_WORKSPACE"
3131
32- - name : Build manylinux wheels
32+ - name : Build wheels (RPM)
3333 run : |
34- set -euo pipefail
35- set -x
36- PROJECT_DIR=$GITHUB_WORKSPACE/projects/amdsmi
37- BUILD_DIR=/tmp/amdsmi-build
38- RAW_WHEELS=/tmp/raw-wheels
39- WHEEL_OUT=$GITHUB_WORKSPACE/wheels
40- PY_BUILD=/opt/python/cp38-cp38/bin/python3
41-
42- echo "Using manylinux image: quay.io/pypa/manylinux_2_28_x86_64"
43-
44- echo "Installing build prerequisites..."
45- dnf -y install git make gcc gcc-c++ cmake ninja-build openssl-devel
46-
47- echo "Configuring and building core..."
48- rm -rf "$BUILD_DIR"
49- mkdir -p "$BUILD_DIR"
50- cd "$BUILD_DIR"
51- cmake "$PROJECT_DIR" \
52- -DBUILD_TESTS=OFF \
53- -DENABLE_ESMI_LIB=ON \
54- -DBUILD_PYTHON_LIB=ON \
55- -DCMAKE_BUILD_TYPE=Release \
56- -DPython3_EXECUTABLE="$PY_BUILD"
57- make -j"$(nproc)"
58-
59- echo "Building wheels for all supported Python versions..."
60- mkdir -p "$RAW_WHEELS" "$WHEEL_OUT"
61- chmod 777 "$WHEEL_OUT"
62- $PY_BUILD -m pip install --upgrade pip setuptools wheel auditwheel
63-
64- for PY in \
65- /opt/python/cp38-cp38/bin/python3 \
66- /opt/python/cp39-cp39/bin/python3 \
67- /opt/python/cp310-cp310/bin/python3 \
68- /opt/python/cp311-cp311/bin/python3 \
69- /opt/python/cp312-cp312/bin/python3 \
70- /opt/python/cp313-cp313/bin/python3; do
71- if [ ! -x "$PY" ]; then
72- echo "Skipping missing interpreter $PY"
73- continue
74- fi
75- echo "Building wheel with $PY"
76- $PY -m pip install --upgrade pip setuptools wheel
77- pushd "$BUILD_DIR/py-interface/python_package"
78- rm -rf build dist *.whl *.egg-info
79- $PY -m pip wheel --no-deps --no-build-isolation -w "$RAW_WHEELS" .
80- popd
81- done
82-
83- echo "Raw wheels built:"
84- ls -al "$RAW_WHEELS" || true
85-
86- if ! ls "$RAW_WHEELS"/*.whl >/dev/null 2>&1; then
87- echo "No wheels were built; aborting."
34+ /opt/python/cp38-cp38/bin/python3 \
35+ "$GITHUB_WORKSPACE/projects/amdsmi/tools/build_wheel_rpm.py" \
36+ --project-dir "$GITHUB_WORKSPACE/projects/amdsmi" \
37+ --output-dir "$GITHUB_WORKSPACE/wheels" \
38+ --os-variant AlmaLinux8
39+
40+ - name : Verify wheels exist
41+ run : |
42+ ls -al "$GITHUB_WORKSPACE/wheels"
43+ if ! ls "$GITHUB_WORKSPACE"/wheels/*.whl >/dev/null 2>&1; then
44+ echo "No wheels found; failing."
8845 exit 1
8946 fi
9047
91- echo "Repairing wheels with auditwheel..."
92- if ! $PY_BUILD -m auditwheel repair "$RAW_WHEELS"/*.whl --wheel-dir "$WHEEL_OUT"; then
93- echo "auditwheel repair failed; keeping raw wheels only."
94- cp -v "$RAW_WHEELS"/*.whl "$WHEEL_OUT"/
95- fi
96- sync
48+ - name : Upload RPM wheels (by SHA)
49+ uses : actions/upload-artifact@v4
50+ with :
51+ name : amdsmi-rpm-wheels-${{ github.sha }}
52+ path : ${{ github.workspace }}/wheels/*.whl
53+ if-no-files-found : error
54+ retention-days : 30
9755
98- echo "Final wheels:"
99- ls -al "$WHEEL_OUT"
56+ - name : Upload RPM wheels (downloadable)
57+ uses : actions/upload-artifact@v4
58+ with :
59+ name : amdsmi-rpm-wheels
60+ path : ${{ github.workspace }}/wheels/*.whl
61+ if-no-files-found : warn
62+ retention-days : 90
63+
64+ debian-wheels :
65+ name : Build Debian Wheels (Ubuntu 22.04)
66+ runs-on : ubuntu-22.04
67+
68+ steps :
69+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
70+
71+ - name : Install build prerequisites
72+ run : |
73+ sudo apt-get update
74+ sudo apt-get install -y git make gcc g++ cmake ninja-build libssl-dev
75+
76+ - name : Build wheels (Debian)
77+ run : |
78+ python3 "$GITHUB_WORKSPACE/projects/amdsmi/tools/build_wheel_debian.py" \
79+ --project-dir "$GITHUB_WORKSPACE/projects/amdsmi" \
80+ --output-dir "$GITHUB_WORKSPACE/wheels"
10081
10182 - name : Verify wheels exist
10283 run : |
103- mkdir -p "$GITHUB_WORKSPACE/wheels"
10484 ls -al "$GITHUB_WORKSPACE/wheels"
10585 if ! ls "$GITHUB_WORKSPACE"/wheels/*.whl >/dev/null 2>&1; then
10686 echo "No wheels found; failing."
10787 exit 1
10888 fi
109- echo "Wheel summary:"
110- for whl in "$GITHUB_WORKSPACE"/wheels/*.whl; do
111- echo " $(basename $whl)"
112- done
11389
114- - name : Upload manylinux wheels (by SHA)
90+ - name : Upload Debian wheels (by SHA)
11591 uses : actions/upload-artifact@v4
11692 with :
117- name : amdsmi-manylinux -wheels-${{ github.sha }}
93+ name : amdsmi-debian -wheels-${{ github.sha }}
11894 path : ${{ github.workspace }}/wheels/*.whl
11995 if-no-files-found : error
12096 retention-days : 30
12197
122- - name : Upload manylinux wheels (downloadable)
98+ - name : Upload Debian wheels (downloadable)
12399 uses : actions/upload-artifact@v4
124100 with :
125- name : amdsmi-python -wheels
101+ name : amdsmi-debian -wheels
126102 path : ${{ github.workspace }}/wheels/*.whl
127103 if-no-files-found : warn
128104 retention-days : 90
0 commit comments