Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude/scheduled_tasks.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"sessionId":"916957a1-57ef-41d3-9ec0-e64d3dcb2c53","pid":161913,"procStart":"403554","acquiredAt":1778992865319}
107 changes: 107 additions & 0 deletions .github/workflows/reflex_compiler_rust_wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Build Rust acceleration wheels

# Builds both reflex-compiler-rust (IR/compiler pipeline) and
# reflex-markdown-rust (pulldown-cmark) wheels. abi3-py310 means one wheel
# per platform covers Python 3.10–3.13. Matrix kept in sync with plan §9.

on:
pull_request:
paths:
- "packages/reflex-compiler-rust/**"
- "packages/reflex-markdown-rust/**"
- ".github/workflows/reflex_compiler_rust_wheels.yml"
push:
branches:
- main
paths:
- "packages/reflex-compiler-rust/**"
- "packages/reflex-markdown-rust/**"
workflow_dispatch:
inputs:
publish:
description: "Publish wheels to PyPI"
required: false
default: "false"
type: choice
options:
- "false"
- "true"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build ${{ matrix.package.name }} (${{ matrix.platform.target }} / ${{ matrix.platform.manylinux || matrix.platform.os }})
runs-on: ${{ matrix.platform.runs-on }}
strategy:
fail-fast: false
matrix:
package:
- { name: reflex-compiler-rust, dir: packages/reflex-compiler-rust, py_module: reflex_compiler_rust, smoke: "from reflex_compiler_rust import _native; print('schema', _native.SCHEMA_VERSION); print('ok')" }
- { name: reflex-markdown-rust, dir: packages/reflex-markdown-rust, py_module: reflex_markdown_rust, smoke: "from reflex_markdown_rust import markdown_to_html; assert '<h1>hi</h1>' in markdown_to_html('# hi'); print('ok')" }
platform:
- { runs-on: ubuntu-22.04, target: x86_64, manylinux: manylinux2014, os: linux }
- { runs-on: ubuntu-22.04, target: x86_64, manylinux: musllinux_1_2, os: linux }
- { runs-on: ubuntu-22.04-arm, target: aarch64, manylinux: manylinux2014, os: linux }
- { runs-on: macos-14, target: aarch64, os: macos }
- { runs-on: macos-13, target: x86_64, os: macos }
- { runs-on: windows-2022, target: x64, os: windows }

steps:
- uses: actions/checkout@v4

- name: Set up Python (host interpreter)
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Build wheel
uses: PyO3/maturin-action@v1
with:
working-directory: ${{ matrix.package.dir }}
target: ${{ matrix.platform.target }}
manylinux: ${{ matrix.platform.manylinux || 'auto' }}
args: --release --out dist --interpreter python3.12
sccache: "true"

- name: Smoke test wheel
if: matrix.platform.os == 'linux' && matrix.platform.target == 'x86_64' && matrix.platform.manylinux == 'manylinux2014'
working-directory: ${{ matrix.package.dir }}
run: |
python -m pip install --upgrade pip
pip install dist/*.whl
python -c "${{ matrix.package.smoke }}"

- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.package.name }}-${{ matrix.platform.os }}-${{ matrix.platform.target }}-${{ matrix.platform.manylinux || 'native' }}
path: ${{ matrix.package.dir }}/dist/*.whl
if-no-files-found: error
retention-days: 7

publish:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment on lines +36 to +85
name: Publish to PyPI
runs-on: ubuntu-22.04
needs: build
if: startsWith(github.ref, 'refs/tags/reflex-compiler-rust-v') || startsWith(github.ref, 'refs/tags/reflex-markdown-rust-v') || github.event.inputs.publish == 'true'
permissions:
id-token: write
steps:
- name: Download all wheels
uses: actions/download-artifact@v4
with:
pattern: wheel-*
path: dist
merge-multiple: true

- name: List wheels
run: ls -la dist/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist
skip-existing: true
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ reflex.db
node_modules
package-lock.json
*.pyi
.pre-commit-config.yaml
.pre-commit-config.yaml
target/
Loading
Loading