Skip to content

Commit 0a84a10

Browse files
committed
workflows: build-numpy: add gpl_sources job
We need to ensure that the GPL sources used in the NumPy builds are provided to be license compliant. Add a new job to get them and pass them along to the publish step. Use a new MANYLINUX_RISCV64_IMAGE variable at the environment level so that the collect-gpl-sources action pulls the sources from the same container image we used for building. Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
1 parent 6dcad44 commit 0a84a10

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

.github/workflows/build-numpy.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ env:
2424
UV_EXTRA_INDEX_URL: https://pypi.riseproject.dev/simple/
2525
UV_INDEX_STRATEGY: unsafe-best-match
2626
UV_ONLY_BINARY: ':all:'
27+
# Pinned explicitly (rather than left to cibuildwheel's default resolution)
28+
# so the gpl_sources job below can pull the exact same image the wheels
29+
# were built in.
30+
MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64
2731

2832
jobs:
2933
build_wheels:
@@ -79,6 +83,7 @@ jobs:
7983
CCACHE_BASEDIR
8084
CCACHE_COMPILERCHECK
8185
CIBW_CONTAINER_ENGINE: "docker; create_args: --volume ${{ env.CCACHE_DIR }}:/root/.ccache"
86+
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
8287

8388
- name: Save compilation cache
8489
if: always() && github.ref == 'refs/heads/main'
@@ -93,9 +98,26 @@ jobs:
9398
path: ./wheelhouse/*.whl
9499
if-no-files-found: error
95100

101+
gpl_sources:
102+
name: Collect GPL sources (gcc) for numpy ${{ inputs.version || '2.5.1' }}
103+
runs-on: ubuntu-24.04-riscv
104+
steps:
105+
- name: Collect gcc source RPM from manylinux_riscv64
106+
uses: riseproject-dev/python-wheels/actions/collect-gpl-sources@main
107+
with:
108+
image: ${{ env.MANYLINUX_RISCV64_IMAGE }}
109+
packages: gcc
110+
output: gpl-sources.tar
111+
112+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
113+
with:
114+
name: numpy-${{ env.NUMPY_VERSION }}-gpl-sources
115+
path: gpl-sources.tar
116+
if-no-files-found: error
117+
96118
publish:
97119
name: Publish numpy ${{ inputs.version || '2.5.1' }} to GitLab
98-
needs: build_wheels
120+
needs: [build_wheels, gpl_sources]
99121
# Only publish when the workflow was triggered from main with a specific
100122
# version. Manual trigger is the only entry point, so checking the ref is
101123
# enough to gate uploads.
@@ -114,3 +136,6 @@ jobs:
114136
gitlab-token: ${{ secrets.GITLAB_DEPLOY_TOKEN }}
115137
gitlab-project-id: ${{ vars.GITLAB_PROJECT_ID }}
116138
gh-token: ${{ secrets.GITHUB_TOKEN }}
139+
gpl-sources-artifact: numpy-${{ env.NUMPY_VERSION }}-gpl-sources
140+
gpl-sources-release-tag: numpy-v${{ env.NUMPY_VERSION }}
141+
gpl-sources-description: gcc

0 commit comments

Comments
 (0)