@@ -2,11 +2,6 @@ name: Build riscv64 wheel
22
33on :
44 workflow_dispatch :
5- inputs :
6- release_tag :
7- description : ' Upstream release tag to build from'
8- required : false
9- type : string
105 schedule :
116 - cron : ' 0 2 * * 0'
127
@@ -18,28 +13,19 @@ jobs:
1813 - name : Checkout
1914 uses : actions/checkout@v4
2015 with :
21- ref : ${{ inputs.release_tag || github.ref }}
2216 fetch-depth : 0
2317
2418 - name : Install system dependencies
2519 run : |
2620 sudo apt-get update
2721 sudo apt-get install -y libffi-dev
2822
29- - name : Set up Python
30- run : |
31- # Remove broken /opt/python from PATH
32- export PATH=$(echo "$PATH" | tr ':' '\n' | grep -v /opt/python | tr '\n' ':' | sed 's/:$//')
33- sudo apt-get install -y python3-venv python3-pip python3-dev
34- /usr/bin/python3 -m venv --without-pip /tmp/build-venv
35- . /tmp/build-venv/bin/activate
36- curl -sS https://bootstrap.pypa.io/get-pip.py | /usr/bin/python3
37- pip install --upgrade setuptools wheel
23+ - name : Set up uv
24+ uses : astral-sh/setup-uv@v7
3825
3926 - name : Build wheel
4027 run : |
41- . /tmp/build-venv/bin/activate
42- pip wheel --no-deps --wheel-dir /tmp/wheels/ .
28+ uvx --python 3.14 pip wheel --no-deps --wheel-dir /tmp/wheels/ .
4329
4430 - name : Verify platform tag
4531 run : |
5945 name : wheel-riscv64
6046 path : /tmp/wheels/*.whl
6147 retention-days : 90
62-
63- - name : Cleanup
64- if : always()
65- run : rm -rf /tmp/build-venv /tmp/wheels
66-
67- release :
68- needs : build
69- runs-on : ubuntu-24.04-riscv
70- if : success()
71- env :
72- GH_REPO : ${{ github.repository }}
73- steps :
74- - name : Checkout
75- uses : actions/checkout@v4
76-
77- - name : Download wheel artifact
78- uses : actions/download-artifact@v4
79- with :
80- name : wheel-riscv64
81- path : /tmp/wheels/
82-
83- - name : Get wheel info
84- id : wheel_info
85- run : |
86- WHL=$(ls /tmp/wheels/*.whl | head -1)
87- BASENAME=$(basename "$WHL")
88- VERSION=$(echo "$BASENAME" | sed 's/^[^-]*-\([^-]*\)-.*/\1/')
89- echo "whl_path=$WHL" >> "$GITHUB_OUTPUT"
90- echo "whl_name=$BASENAME" >> "$GITHUB_OUTPUT"
91- echo "version=$VERSION" >> "$GITHUB_OUTPUT"
92-
93- - name : Generate checksums
94- run : |
95- cd /tmp/wheels
96- sha256sum *.whl > SHA256SUMS
97-
98- - name : Create or update release
99- env :
100- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
101- run : |
102- TAG="riscv64-v${{ steps.wheel_info.outputs.version }}"
103- TITLE="riscv64 wheel v${{ steps.wheel_info.outputs.version }}"
104- gh release delete "$TAG" --yes 2>/dev/null || true
105- git tag -d "$TAG" 2>/dev/null || true
106- git push origin ":refs/tags/$TAG" 2>/dev/null || true
107- gh release create "$TAG" --title "$TITLE" --notes "Prebuilt riscv64 wheel for $(uname -m) Linux.
108-
109- Built on: BananaPi F3 (SpacemiT K1, rv64imafdcv)
110- Python: $(python3 --version 2>&1)
111- Wheel: ${{ steps.wheel_info.outputs.whl_name }}
112-
113- Install:
114- \`\`\`
115- pip install cffi --find-links https://github.com/gounthar/$(basename $PWD)/releases/download/$TAG/
116- \`\`\`" /tmp/wheels/*.whl /tmp/wheels/SHA256SUMS
117-
118- - name : Cleanup
119- if : always()
120- run : rm -rf /tmp/wheels
121- notify-index :
122- needs : release
123- runs-on : ubuntu-latest
124- if : success()
125- steps :
126- - name : Trigger index update
127- env :
128- GH_TOKEN : ${{ secrets.DISPATCH_TOKEN }}
129- run : |
130- gh api repos/gounthar/riscv64-python-wheels/dispatches \
131- -f event_type=fork-release-published \
132- -f "client_payload[repo]=${{ github.repository }}" \
133- -f "client_payload[tag]=${{ github.ref_name }}"
0 commit comments