| 1 |
name: dists |
| 2 |
|
| 3 |
on: |
| 4 |
pull_request: |
| 5 |
push: |
| 6 |
branches: [master] |
| 7 |
release: |
| 8 |
types: [released, prereleased] |
| 9 |
workflow_dispatch: # allows running workflow manually from the Actions tab |
| 10 |
|
| 11 |
concurrency: # https://stackoverflow.com/questions/66335225#comment133398800_72408109 |
| 12 |
group: ${{ github.workflow }}-${{ github.ref || github.run_id }} |
| 13 |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
| 14 |
|
| 15 |
jobs: |
| 16 |
wheel: |
| 17 |
name: ${{ matrix.os }}-${{ matrix.target }}-${{ matrix.manylinux }} |
| 18 |
strategy: |
| 19 |
fail-fast: false |
| 20 |
matrix: |
| 21 |
include: |
| 22 |
- { os: macos-15, target: x86_64, manylinux: auto} |
| 23 |
- { os: macos-15, target: aarch64, manylinux: auto} |
| 24 |
- { os: ubuntu-24.04, target: x86_64, manylinux: auto} |
| 25 |
- { os: ubuntu-24.04, target: aarch64, manylinux: auto} |
| 26 |
- { os: ubuntu-24.04, target: i686, manylinux: auto} |
| 27 |
- { os: ubuntu-24.04, target: armv7, manylinux: auto} |
| 28 |
- { os: ubuntu-24.04, target: ppc64le, manylinux: auto} |
| 29 |
- { os: ubuntu-24.04, target: s390x, manylinux: auto} |
| 30 |
- { os: ubuntu-24.04, target: x86_64, manylinux: musllinux_1_1 } |
| 31 |
- { os: ubuntu-24.04, target: aarch64, manylinux: musllinux_1_1 } |
| 32 |
- { os: windows-2025, target: x86_64, manylinux: auto} |
| 33 |
- { os: windows-2025, target: i686, manylinux: auto} |
| 34 |
|
| 35 |
runs-on: ${{ matrix.os }} |
| 36 |
steps: |
| 37 |
- uses: actions/checkout@v5 |
| 38 |
|
| 39 |
# keep python versions in sync with |
| 40 |
# - pyproject.toml |
| 41 |
# - tests.yml |
| 42 |
# all python versions need to be present for linking to succeed |
| 43 |
- uses: actions/setup-python@v6 |
| 44 |
with: |
| 45 |
python-version: '3.8' |
| 46 |
architecture: ${{ ( startsWith(matrix.os, 'windows') && matrix.target == 'i686' ) && 'x86' || null }} |
| 47 |
- uses: actions/setup-python@v6 |
| 48 |
with: |
| 49 |
python-version: '3.9' |
| 50 |
architecture: ${{ ( startsWith(matrix.os, 'windows') && matrix.target == 'i686' ) && 'x86' || null }} |
| 51 |
- uses: actions/setup-python@v6 |
| 52 |
with: |
| 53 |
python-version: '3.10' |
| 54 |
architecture: ${{ ( startsWith(matrix.os, 'windows') && matrix.target == 'i686' ) && 'x86' || null }} |
| 55 |
- uses: actions/setup-python@v6 |
| 56 |
with: |
| 57 |
python-version: '3.11' |
| 58 |
architecture: ${{ ( startsWith(matrix.os, 'windows') && matrix.target == 'i686' ) && 'x86' || null }} |
| 59 |
- uses: actions/setup-python@v6 |
| 60 |
with: |
| 61 |
python-version: '3.12' |
| 62 |
architecture: ${{ ( startsWith(matrix.os, 'windows') && matrix.target == 'i686' ) && 'x86' || null }} |
| 63 |
- uses: actions/setup-python@v6 |
| 64 |
with: |
| 65 |
python-version: '3.13' |
| 66 |
architecture: ${{ ( startsWith(matrix.os, 'windows') && matrix.target == 'i686' ) && 'x86' || null }} |
| 67 |
- uses: actions/setup-python@v6 |
| 68 |
with: |
| 69 |
python-version: '3.14' |
| 70 |
architecture: ${{ ( startsWith(matrix.os, 'windows') && matrix.target == 'i686' ) && 'x86' || null }} |
| 71 |
|
| 72 |
- uses: PyO3/[email protected] |
| 73 |
with: |
| 74 |
target: ${{ matrix.target }} |
| 75 |
manylinux: ${{ matrix.manylinux }} |
| 76 |
# keep python versions in sync with tests.yml |
| 77 |
args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12 3.13 3.14' |
| 78 |
rust-toolchain: stable |
| 79 |
docker-options: -e CI |
| 80 |
|
| 81 |
# The freethreaded builds are separated out because of a setup-python issue |
| 82 |
# on Windows causing maturin-action to pick up e.g. the 3.13t exe instead |
| 83 |
# of the 3.13 exe. See https://github.com/oconnor663/blake3-py/issues/52. |
| 84 |
- uses: actions/setup-python@v6 |
| 85 |
with: |
| 86 |
python-version: '3.13t' |
| 87 |
architecture: ${{ ( startsWith(matrix.os, 'windows') && matrix.target == 'i686' ) && 'x86' || null }} |
| 88 |
- uses: actions/setup-python@v6 |
| 89 |
with: |
| 90 |
python-version: '3.14t' |
| 91 |
architecture: ${{ ( startsWith(matrix.os, 'windows') && matrix.target == 'i686' ) && 'x86' || null }} |
| 92 |
- uses: PyO3/[email protected] |
| 93 |
with: |
| 94 |
target: ${{ matrix.target }} |
| 95 |
manylinux: ${{ matrix.manylinux }} |
| 96 |
# keep python versions in sync with tests.yml |
| 97 |
args: --release --out dist --interpreter '3.13t 3.14t' |
| 98 |
rust-toolchain: stable |
| 99 |
docker-options: -e CI |
| 100 |
|
| 101 |
- run: ${{ (startsWith(matrix.os, 'windows') && 'dir') || 'ls -ltra' }} dist/ |
| 102 |
|
| 103 |
- uses: actions/upload-artifact@v4 |
| 104 |
with: |
| 105 |
name: dist-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.manylinux }} |
| 106 |
path: dist |
| 107 |
|
| 108 |
sdist: |
| 109 |
name: sdist |
| 110 |
runs-on: ubuntu-24.04 |
| 111 |
steps: |
| 112 |
- uses: actions/checkout@v5 |
| 113 |
|
| 114 |
- uses: PyO3/[email protected] |
| 115 |
with: |
| 116 |
command: sdist |
| 117 |
args: --out dist |
| 118 |
rust-toolchain: stable |
| 119 |
|
| 120 |
- uses: actions/upload-artifact@v4 |
| 121 |
with: |
| 122 |
name: dist-sdist |
| 123 |
path: dist |
| 124 |
|
| 125 |
publish: |
| 126 |
if: github.event_name == 'release' |
| 127 |
needs: [wheel, sdist] |
| 128 |
runs-on: ubuntu-24.04 |
| 129 |
|
| 130 |
permissions: |
| 131 |
contents: write # softprops/action-gh-release |
| 132 |
id-token: write # pypa/gh-action-pypi-publish |
| 133 |
|
| 134 |
steps: |
| 135 |
- uses: actions/download-artifact@v5 |
| 136 |
with: |
| 137 |
path: dist/ |
| 138 |
pattern: dist-* |
| 139 |
merge-multiple: true |
| 140 |
|
| 141 |
- run: ls -ltra dist/ |
| 142 |
|
| 143 |
- name: Upload release assets |
| 144 |
uses: softprops/[email protected] |
| 145 |
with: |
| 146 |
files: dist/* |
| 147 |
|
| 148 |
# trusted publisher in https://pypi.org/manage/project/blake3/settings/publishing/ |
| 149 |
- name: Publish package distributions to PyPI |
| 150 |
uses: pypa/[email protected] |
| 151 |
with: |
| 152 |
skip-existing: true |