Repository navigation
workflows: migrate canonical cibuildwheel builds #18
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-FileCopyrightText: 2026 The RISE Project | |
| # SPDX-License-Identifier: MIT | |
| --- | |
| # This workflow is based on the `build_wheels` job of | |
| # https://github.com/m3g/packmol/blob/v21.2.3/.github/workflows/build-wheels.yaml | |
| name: Build packmol wheels (riscv64) | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version glob to (re)build; empty builds every version of docs/packages/packmol.yaml not released yet' | |
| required: false | |
| default: '' | |
| cancel-in-progress: | |
| description: Cancel an in-progress run in the same concurrency group. | |
| required: false | |
| type: boolean | |
| default: true | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/build-packmol.yml' | |
| - 'docs/packages/packmol.yaml' | |
| push: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/build-packmol.yml' | |
| - 'docs/packages/packmol.yaml' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: ${{ case(github.event_name == 'pull_request', true, github.event_name == 'workflow_dispatch', inputs['cancel-in-progress'], false) }} | |
| permissions: | |
| contents: read # to fetch code (actions/checkout) | |
| env: | |
| MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 | |
| jobs: | |
| setup: | |
| uses: $/.github/workflows/_setup.yml | |
| with: | |
| package: packmol | |
| version: ${{ inputs.version }} | |
| build_wheels: | |
| needs: [setup] | |
| if: needs.setup.outputs.versions != '[]' | |
| name: Build packmol ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: ${{ fromJSON(needs.setup.outputs.matrix) }} | |
| uses: $/.github/workflows/_build-cibuildwheel.yml | |
| with: | |
| package: "packmol" | |
| version: "${{ matrix.version }}" | |
| repository: "m3g/packmol" | |
| ref: "v${{ matrix.version }}" | |
| artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" | |
| cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" | |
| # Upstream FLAGS minus -march=native, which GCC rejects on riscv64. FLAGS is also | |
| # the link line: link packmol PIE so auditwheel's patchelf --set-rpath appends its | |
| # segment instead of prepending one below vm.mmap_min_addr (gotcha 595). Not | |
| # -Wl,-Ttext-segment: musllinux's default-PIE gcc then emits an ET_EXEC that | |
| # still carries PIE relocations, and patchelf's rewrite of it segfaults at start. | |
| cibw-environment-linux: "MAKEFLAGS='FLAGS=-O3\\ -funroll-loops\\ -fPIE\\ -pie'" | |
| gpl_sources: | |
| needs: [setup] | |
| if: needs.setup.outputs.versions != '[]' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ fromJSON(needs.setup.outputs.versions) }} | |
| # packmol is a gfortran-built executable, so auditwheel vendors its libgfortran runtime. | |
| name: Collect GPL sources (gcc) for packmol ${{ matrix.version }} | |
| runs-on: ubuntu-24.04-riscv | |
| steps: | |
| - name: Collect gcc source RPM from manylinux_riscv64 | |
| uses: riseproject-dev/python-wheels/actions/collect-gpl-sources@main | |
| with: | |
| image: ${{ env.MANYLINUX_RISCV64_IMAGE }} | |
| packages: gcc | |
| output: gpl-sources.tar | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: packmol-${{ matrix.version }}-gpl-sources | |
| path: gpl-sources.tar | |
| if-no-files-found: error | |
| publish: | |
| name: Publish packmol ${{ matrix.version }} | |
| needs: [setup, build_wheels, gpl_sources] | |
| if: needs.setup.outputs.versions != '[]' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ fromJSON(needs.setup.outputs.versions) }} | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| uses: $/.github/workflows/_publish-wheel.yml | |
| secrets: | |
| app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }} | |
| with: | |
| matrix: ${{ needs.setup.outputs.matrix }} | |
| artifact-pattern: packmol-${{ matrix.version }}-*riscv64 | |
| gpl-sources-artifact: packmol-${{ matrix.version }}-gpl-sources | |
| gpl-sources-description: gcc |