Skip to content

Commit d008438

Browse files
authored
tree-sitter-php: add build-tree-sitter-php.yml for riscv64 wheels (#855)
* **Package**: `tree-sitter-php` * **Version**: `0.24.1` * **Source**: https://github.com/tree-sitter/tree-sitter-php * **Docs**: https://github.com/tree-sitter/tree-sitter-php Compiles the `php` and `php_only` tree-sitter grammars into one `tree_sitter_php` extension. Upstream publishes no riscv64 wheel. Mirrors [upstream's `package-pypi.yml`](https://github.com/tree-sitter/workflows/blob/main/.github/workflows/package-pypi.yml), same shape as the merged tree-sitter-java/c-sharp/ruby workflows. **Differs from upstream** - Nothing beyond the riscv64 image. **Testing** - same as upstream **License**: OK Built on cp312; 2 passed, 0 skipped.
1 parent 0885a70 commit d008438

1 file changed

Lines changed: 71 additions & 0 deletions

File tree

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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-php wheels (riscv64)
7+
8+
on:
9+
workflow_dispatch:
10+
inputs:
11+
version:
12+
description: 'tree-sitter-php version to build (git tag without leading v, e.g. 0.24.1)'
13+
required: true
14+
default: '0.24.1'
15+
pull_request:
16+
paths:
17+
- '.github/workflows/build-tree-sitter-php.yml'
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ inputs.version || '0.24.1' }}-${{ 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_PHP_VERSION: ${{ inputs.version || '0.24.1' }}
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-php ${{ inputs.version || '0.24.1' }} cp310-abi3-manylinux_riscv64
37+
runs-on: ubuntu-24.04-riscv
38+
timeout-minutes: 120
39+
40+
steps:
41+
- name: Checkout tree-sitter-php v${{ env.TREE_SITTER_PHP_VERSION }}
42+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
43+
with:
44+
repository: tree-sitter/tree-sitter-php
45+
ref: v${{ env.TREE_SITTER_PHP_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-php-${{ env.TREE_SITTER_PHP_VERSION }}-cp310-abi3-manylinux_riscv64
60+
path: ./wheelhouse/*.whl
61+
if-no-files-found: error
62+
63+
publish:
64+
name: Publish tree-sitter-php ${{ inputs.version || '0.24.1' }}
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-php-${{ inputs.version || '0.24.1' }}-*-manylinux_riscv64

0 commit comments

Comments
 (0)