openai/tiktoken
Publicmirrored fromhttps://github.com/openai/tiktokenAvailable
.github/workflows/build_wheels.yml
53lines · modecode
| 1 | name: Build wheels |
| 2 | |
| 3 | on: [push, pull_request, workflow_dispatch] |
| 4 | |
| 5 | concurrency: |
| 6 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 7 | cancel-in-progress: true |
| 8 | |
| 9 | jobs: |
| 10 | build_wheels: |
| 11 | name: py${{ matrix.python-version }} on ${{ matrix.os }} |
| 12 | runs-on: ${{ matrix.os }} |
| 13 | strategy: |
| 14 | fail-fast: false |
| 15 | matrix: |
| 16 | # cibuildwheel builds linux wheels inside a manylinux container |
| 17 | # it also takes care of procuring the correct python version for us |
| 18 | os: [ubuntu-latest, windows-latest, macos-latest] |
| 19 | python-version: [38, 39, 310, 311] |
| 20 | |
| 21 | steps: |
| 22 | - uses: actions/checkout@v3 |
| 23 | |
| 24 | - uses: pypa/cibuildwheel@v2.11.3 |
| 25 | env: |
| 26 | CIBW_BUILD: "cp${{ matrix.python-version}}-*" |
| 27 | |
| 28 | - uses: actions/upload-artifact@v3 |
| 29 | with: |
| 30 | name: dist |
| 31 | path: ./wheelhouse/*.whl |
| 32 | |
| 33 | build_sdist: |
| 34 | name: sdist |
| 35 | runs-on: ubuntu-latest |
| 36 | steps: |
| 37 | - uses: actions/checkout@v3 |
| 38 | - uses: actions/setup-python@v4 |
| 39 | name: Install Python |
| 40 | with: |
| 41 | python-version: "3.9" |
| 42 | - name: Run check-manifest |
| 43 | run: | |
| 44 | pip install check-manifest |
| 45 | check-manifest -v |
| 46 | - name: Build sdist |
| 47 | run: | |
| 48 | pip install --upgrade build |
| 49 | python -m build --sdist |
| 50 | - uses: actions/upload-artifact@v3 |
| 51 | with: |
| 52 | name: dist |
| 53 | path: ./dist/*.tar.gz |
| 54 | |