Skip to content

Commit bd91fe2

Browse files
authored
Merge pull request #3 from AmpereComputingAI/ampere-build-3.2.1-devel
Ampere build 3.2.1 devel
2 parents 37d29d4 + 6f5ece3 commit bd91fe2

File tree

1 file changed

+51
-6
lines changed

1 file changed

+51
-6
lines changed

.github/workflows/ampere-build-and-release.yaml

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,39 +28,84 @@ jobs:
2828
token: ${{ secrets.ACCESS_TOKEN }}
2929
submodules: recursive
3030

31+
- uses: actions/setup-python@v5
32+
with:
33+
python-version: "3.11"
34+
3135
- name: Install cibuildwheel
32-
run: python3 -m pip install cibuildwheel==2.22.0
36+
run: python -m pip install cibuildwheel==2.22.0
3337

3438
- name: Build wheels
35-
run: python3 -m cibuildwheel --output-dir wheelhouse
39+
run: python -m cibuildwheel --output-dir wheelhouse
3640
env:
3741
CIBW_SKIP: "*musllinux* pp*"
3842
CIBW_REPAIR_WHEEL_COMMAND: ""
3943
CIBW_ARCHS: "aarch64"
40-
CIBW_ENVIRONMENT: 'CMAKE_ARGS="-DGGML_NATIVE=ON"'
44+
CIBW_MANYLINUX_AARCH64_IMAGE: "quay.io/pypa/manylinux_2_34_aarch64"
45+
CIBW_BEFORE_ALL: "dnf install -y gcc-toolset-13"
46+
CIBW_ENVIRONMENT: >
47+
CC=/opt/rh/gcc-toolset-13/root/usr/bin/gcc
48+
CXX=/opt/rh/gcc-toolset-13/root/usr/bin/g++
49+
CMAKE_ARGS="-DGGML_NATIVE=OFF
50+
-DCMAKE_CXX_FLAGS=-march=armv8.2-a+dotprod+fp16
51+
-DCMAKE_C_FLAGS=-march=armv8.2-a+dotprod+fp16"
4152
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*"
4253

43-
- name: Upload wheels as artifacts
44-
uses: actions/upload-artifact@v4
54+
- name: Inspect wheel contents
55+
run: |
56+
for whl in wheelhouse/*.whl; do
57+
echo "=== $(basename $whl) ==="
58+
python -m zipfile -l "$whl"
59+
done
60+
61+
- uses: actions/upload-artifact@v4
4562
with:
4663
name: wheels_arm64
4764
path: ./wheelhouse/*.whl
4865

4966
release:
5067
name: Release
5168
needs: [build_wheels_arm64]
69+
if: startsWith(github.ref, 'refs/tags/')
5270
runs-on: [self-hosted]
5371
container:
5472
image: ubuntu:22.04
5573

5674
steps:
5775
- uses: actions/download-artifact@v4
5876
with:
59-
merge-multiple: true
77+
name: wheels_arm64
6078
path: dist
6179

6280
- uses: softprops/action-gh-release@v2
6381
with:
6482
files: dist/*
6583
env:
6684
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85+
86+
publish:
87+
name: Publish to PyPI
88+
needs: [build_wheels_arm64]
89+
if: startsWith(github.ref, 'refs/tags/')
90+
runs-on: [self-hosted]
91+
container:
92+
image: ubuntu:22.04
93+
94+
steps:
95+
- name: Install prerequisites
96+
run: |
97+
apt-get update
98+
apt-get install -y python3 python3-pip
99+
100+
- uses: actions/download-artifact@v4
101+
with:
102+
name: wheels_arm64
103+
path: dist/
104+
105+
- name: Publish to PyPI
106+
run: |
107+
python3 -m pip install twine
108+
python3 -m twine upload --non-interactive dist/*.whl
109+
env:
110+
TWINE_USERNAME: __token__
111+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}

0 commit comments

Comments
 (0)