|
| 1 | +# SPDX-FileCopyrightText: 2026 The RISE Project |
| 2 | +# SPDX-License-Identifier: MIT |
| 3 | +--- |
| 4 | +# Based on upstream's wheel builder: |
| 5 | +# https://github.com/tree-sitter/workflows/blob/main/.github/workflows/package-pypi.yml |
| 6 | +name: Build tree-sitter-elixir wheels (riscv64) |
| 7 | + |
| 8 | +on: |
| 9 | + workflow_dispatch: |
| 10 | + inputs: |
| 11 | + version: |
| 12 | + description: 'tree-sitter-elixir version to build (git tag without leading v, e.g. 0.3.5)' |
| 13 | + required: true |
| 14 | + default: '0.3.5' |
| 15 | + pull_request: |
| 16 | + paths: |
| 17 | + - '.github/workflows/build-tree-sitter-elixir.yml' |
| 18 | + |
| 19 | +concurrency: |
| 20 | + group: ${{ github.workflow }}-${{ inputs.version || '0.3.5' }}-${{ github.head_ref || github.run_id }} |
| 21 | + cancel-in-progress: true |
| 22 | + |
| 23 | +permissions: |
| 24 | + contents: read # to fetch code (actions/checkout) |
| 25 | + |
| 26 | +env: |
| 27 | + TREE_SITTER_ELIXIR_VERSION: ${{ inputs.version || '0.3.5' }} |
| 28 | + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 |
| 29 | + |
| 30 | +jobs: |
| 31 | + setup: |
| 32 | + uses: $/.github/workflows/_setup.yml |
| 33 | + |
| 34 | + build_wheels: |
| 35 | + needs: [setup] |
| 36 | + name: Build tree-sitter-elixir ${{ inputs.version || '0.3.5' }} cp39-abi3-manylinux_riscv64 |
| 37 | + runs-on: ubuntu-24.04-riscv |
| 38 | + timeout-minutes: 120 |
| 39 | + |
| 40 | + steps: |
| 41 | + - name: Checkout tree-sitter-elixir v${{ env.TREE_SITTER_ELIXIR_VERSION }} |
| 42 | + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 43 | + with: |
| 44 | + repository: elixir-lang/tree-sitter-elixir |
| 45 | + ref: v${{ env.TREE_SITTER_ELIXIR_VERSION }} |
| 46 | + persist-credentials: false |
| 47 | + |
| 48 | + - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 |
| 49 | + env: |
| 50 | + CIBW_ARCHS: riscv64 |
| 51 | + CIBW_BUILD: cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 |
| 52 | + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} |
| 53 | + CIBW_TEST_EXTRAS: core |
| 54 | + CIBW_TEST_SOURCES: bindings/python/tests |
| 55 | + CIBW_TEST_COMMAND: python -m unittest discover -v -s bindings/python/tests |
| 56 | + |
| 57 | + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 58 | + with: |
| 59 | + name: tree-sitter-elixir-${{ env.TREE_SITTER_ELIXIR_VERSION }}-cp39-abi3-manylinux_riscv64 |
| 60 | + path: ./wheelhouse/*.whl |
| 61 | + if-no-files-found: error |
| 62 | + |
| 63 | + publish: |
| 64 | + name: Publish tree-sitter-elixir ${{ inputs.version || '0.3.5' }} |
| 65 | + needs: [setup, build_wheels] |
| 66 | + permissions: |
| 67 | + contents: write |
| 68 | + pull-requests: write |
| 69 | + uses: $/.github/workflows/_publish-wheel.yml |
| 70 | + with: |
| 71 | + artifact-pattern: tree-sitter-elixir-${{ inputs.version || '0.3.5' }}-*-manylinux_riscv64 |
0 commit comments