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