Skip to content

Commit 0c0a683

Browse files
committed
Use cibuildwheel action
1 parent e3652c2 commit 0c0a683

1 file changed

Lines changed: 17 additions & 101 deletions

File tree

.github/workflows/cibuildwheel.yml

Lines changed: 17 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -7,105 +7,21 @@ on:
77
# ** matches 'zero or more of any character'
88
- 'release-v[0-9]+.[0-9]+.[0-9]+**'
99
- 'prerelease-v[0-9]+.[0-9]+.[0-9]+**'
10-
jobs:
11-
build_wheels:
12-
name: Build wheels on ${{ matrix.os }}
13-
runs-on: ${{ matrix.os }}
14-
strategy:
15-
matrix:
16-
# macos-13 is an intel runner, macos-14 is apple silicon
17-
os: [ubuntu-latest, windows-2022, macos-13, macos-14, ubuntu-24.04-arm]
18-
19-
steps:
20-
# See https://cibuildwheel.pypa.io/en/1.x/cpp_standards/
21-
- uses: ilammy/msvc-dev-cmd@v1
22-
- uses: actions/checkout@v4
23-
# This is crazy slow. We'll need to wait for arm Linux
24-
# runners.
25-
# aarch64 (arm) is built via qemu emulation on Linux
26-
#- name: Set up QEMU
27-
# if: runner.os == 'Linux'
28-
# uses: docker/setup-qemu-action@v3
29-
# with:
30-
# platforms: all
31-
- name: Debug env
32-
run: env
33-
- name: Build wheels
34-
uses: pypa/cibuildwheel@v2.21.3
35-
env:
36-
CIBW_ARCHS_LINUX: auto
37-
DISTUTILS_USE_SDK: 1
38-
MSSdk: 1
39-
AR: llvm-ar
40-
AS: llvm-as
41-
CC: clang
42-
RANLIB: echo
43-
CIBW_BUILD_VERBOSITY: 5
44-
with:
45-
package-dir: .
46-
output-dir: wheelhouse
47-
config-file: "{package}/pyproject.toml"
48-
- uses: actions/upload-artifact@v4
49-
with:
50-
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
51-
path: ./wheelhouse/*.whl
5210

53-
build_sdist:
54-
name: Build source distribution
55-
runs-on: ubuntu-latest
56-
steps:
57-
- uses: actions/checkout@v4
58-
59-
- name: Build sdist
60-
run: pipx run build --sdist
61-
- uses: actions/upload-artifact@v4
62-
with:
63-
name: cibw-sdist
64-
path: dist/*.tar.gz
65-
create_release:
66-
needs: [build_wheels, build_sdist]
67-
runs-on: ubuntu-latest
68-
permissions:
69-
contents: write
70-
checks: write
71-
actions: read
72-
issues: read
73-
packages: write
74-
pull-requests: read
75-
repository-projects: read
76-
statuses: read
77-
steps:
78-
- name: Get the tag name and determine if it's a prerelease
79-
id: get_tag_info
80-
run: |
81-
FULL_TAG=${GITHUB_REF#refs/tags/}
82-
if [[ $FULL_TAG == release-* ]]; then
83-
TAG_NAME=${FULL_TAG#release-}
84-
IS_PRERELEASE=false
85-
elif [[ $FULL_TAG == prerelease-* ]]; then
86-
TAG_NAME=${FULL_TAG#prerelease-}
87-
IS_PRERELEASE=true
88-
else
89-
echo "Tag does not match expected patterns" >&2
90-
exit 1
91-
fi
92-
echo "FULL_TAG=$TAG_NAME" >> $GITHUB_ENV
93-
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
94-
echo "IS_PRERELEASE=$IS_PRERELEASE" >> $GITHUB_ENV
95-
- uses: actions/download-artifact@v4
96-
with:
97-
# unpacks all CIBW artifacts into dist/
98-
pattern: cibw-*
99-
path: dist
100-
merge-multiple: true
101-
- name: Create Draft Release
102-
id: create_release
103-
uses: softprops/action-gh-release@v2
104-
if: startsWith(github.ref, 'refs/tags/')
105-
env:
106-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107-
with:
108-
name: ${{ env.TAG_NAME }}
109-
draft: true
110-
prerelease: ${{ env.IS_PRERELEASE }}
111-
files: "./dist/*"
11+
jobs:
12+
build:
13+
uses: explosion/gha-cibuildwheel/.github/workflows/cibuildwheel.yml@main
14+
with:
15+
wheel-name-pattern: "blis-*.whl"
16+
env: |
17+
{
18+
"DISTUTILS_USE_SDK": "1",
19+
"MSSdk": "1",
20+
"AR": "llvm-ar",
21+
"AS": "llvm-as",
22+
"CC": "clang",
23+
"RANLIB": "echo",
24+
"CIBW_BUILD_VERBOSITY": "5"
25+
}
26+
secrets:
27+
gh-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)