Skip to content

Commit 1614bf4

Browse files
committed
video_reader-rs_build.yml: add build workflow
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
1 parent 1887a91 commit 1614bf4

1 file changed

Lines changed: 92 additions & 0 deletions

File tree

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags:
7+
- '*'
8+
pull_request:
9+
branches: [main]
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
linux:
16+
runs-on: ${{ matrix.platform.runner }}
17+
strategy:
18+
matrix:
19+
platform:
20+
- runner: ubuntu-24.04-riscv
21+
target: riscv64gc-unknown-linux-gnu
22+
arch: riscv64
23+
env:
24+
FFMPEG_DIR: ${{ github.workspace }}/ffmpeg
25+
FFMPEG_VERS: 8.1-1
26+
FFMPEG_BASE_URL: https://github.com/PyAV-Org/pyav-ffmpeg/releases/download
27+
steps:
28+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
29+
with:
30+
persist-credentials: false
31+
32+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
33+
with:
34+
repository: https://github.com/gcanat/video_reader-rs.git
35+
ref: v0.4.3
36+
path: upstream
37+
38+
# actions/setup-python doesn't support riscv64 yet, so work around that by
39+
# using a recent astral-sh/setup-uv action and activate it automatically
40+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
41+
with:
42+
python-version: '3.11'
43+
activate-environment: true
44+
working-directory: upstream
45+
46+
- name: Set download url
47+
id: download_url
48+
run: |
49+
DOWNLOAD_URL=$(
50+
echo "${{ env.FFMPEG_BASE_URL }}/${{ env.FFMPEG_VERS }}/ffmpeg-manylinux-${{ matrix.platform.arch }}.tar.gz";
51+
)
52+
echo "ffmpeg_url=$DOWNLOAD_URL" >> $GITHUB_OUTPUT
53+
54+
- name: Build wheels
55+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
56+
with:
57+
working-directory: upstream
58+
target: ${{ matrix.platform.target }}
59+
before-script-linux: |
60+
dnf install -y clang
61+
curl -L "${{ steps.download_url.outputs.ffmpeg_url }}" -o ffmpeg.tar.gz
62+
mkdir -p ${{ env.FFMPEG_DIR }}
63+
tar -zxf ffmpeg.tar.gz -C ${{ env.FFMPEG_DIR }}
64+
args: --release --out dist --interpreter '3.9 3.10 3.11 3.12 3.13 3.13t 3.14 3.14t pypy3.11'
65+
manylinux: 2_39
66+
docker-options: -e CI -e FFMPEG_DIR=${{ env.FFMPEG_DIR }}
67+
- name: Upload wheels
68+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
69+
with:
70+
name: wheels-linux-${{ matrix.platform.arch }}
71+
path: dist
72+
working-directory: upstream
73+
74+
# release:
75+
# name: Release
76+
# runs-on: ubuntu-latest
77+
# if: "startsWith(github.ref, 'refs/tags/')"
78+
# needs: [linux]
79+
# permissions:
80+
# id-token: write
81+
# steps:
82+
# - name: Download artifacts
83+
# uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
84+
# with:
85+
# path: dist
86+
# merge-multiple: true
87+
# - name: Install uv
88+
# uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
89+
# - name: Publish to PyPI
90+
# env:
91+
# UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
92+
# run: uv publish

0 commit comments

Comments
 (0)