bench: stabilize cross-api hot-path timings #360
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
| name: Release | |
| concurrency: | |
| group: ${{ github.event.inputs.ref || github.ref }}-workflow-release | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| release: | |
| types: [ published ] | |
| repository_dispatch: | |
| workflow_dispatch: | |
| inputs: | |
| ref: | |
| description: 'Branch, Tag or Commit SHA' | |
| required: false | |
| default: '' | |
| pr_number: | |
| description: 'PR Number' | |
| required: false | |
| type: number | |
| upload_pypi: | |
| description: 'Upload to PyPI' | |
| type: boolean | |
| required: false | |
| default: false | |
| upload_release: | |
| description: 'Upload to release (it only works with a tag ref)' | |
| type: boolean | |
| required: false | |
| default: false | |
| env: | |
| RELEASE_MODE: 1 | |
| CI: 1 | |
| MAX_JOBS: 4 | |
| ref: ${{ github.event.inputs.ref || github.ref }} | |
| jobs: | |
| release-source: | |
| runs-on: ubuntu-latest | |
| if: (github.event_name == 'release' || github.event.inputs.upload_pypi == 'true') && !cancelled() | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| ref: ${{ env.ref }} | |
| - uses: actions/setup-python@v7 | |
| with: | |
| python-version: 3.14 | |
| cache: 'pip' | |
| - name: Install requirements | |
| run: | | |
| pip install uv | |
| uv pip install build "setuptools>=77.0.1,<83" twine packaging -U --system | |
| - name: Build package | |
| run: | | |
| python -m build --sdist | |
| - name: Test install | |
| run: | | |
| twine check dist/* | |
| uv pip install dist/* --system | |
| - name: Upload source artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: sources | |
| path: dist/*.tar.gz | |
| - name: Upload sdist to pypi | |
| if: (github.event_name == 'release' || github.event.inputs.upload_pypi == 'true') && !cancelled() | |
| env: | |
| TWINE_USERNAME: "__token__" | |
| TWINE_PASSWORD: ${{ secrets.PYPI_KEY }} | |
| run: | | |
| python -m twine upload dist/*gz | |
| release: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ ubuntu-latest, macos-latest, windows-latest ] | |
| py: [ '3.10', '3.11', '3.12', '3.13', '3.14', '3.14t' ] # no '3.13t', because RuntimeError: CFFI does not support the free-threaded build of CPython 3.13. Upgrade to free-threaded 3.14 or newer to use CFFI with the free-threaded build. | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout Codes | |
| uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| ref: ${{ env.ref }} | |
| - uses: actions/setup-python@v7 | |
| with: | |
| python-version: ${{ matrix.py }} | |
| cache: 'pip' | |
| - name: Add msbuild to PATH | |
| if: runner.os == 'Windows' | |
| uses: microsoft/setup-msbuild@v3 | |
| - name: Install requirements | |
| run: | | |
| which python | |
| python -V | |
| pip install uv | |
| uv pip install build "setuptools>=77.0.1,<83" twine packaging cmake wheel ninja -U --system | |
| - name: Compile | |
| run: | | |
| python -V | |
| python -m build -w --no-isolation | |
| - name: Test install | |
| shell: bash | |
| run: | | |
| python -V | |
| whl=$(ls -t dist/*.whl | head -n 1 | xargs basename) | |
| echo "WHL_NAME=$whl" >> $GITHUB_ENV | |
| twine check dist/$whl | |
| uv pip install dist/* --system | |
| - name: Upload wheel artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ env.WHL_NAME }} | |
| path: dist/${{ env.WHL_NAME }} |