Skip to content

Commit 09b4eb4

Browse files
committed
Use reuseable gha
1 parent 38056e9 commit 09b4eb4

File tree

2 files changed

+8
-86
lines changed

2 files changed

+8
-86
lines changed

.github/workflows/cibuildwheel.yml

Lines changed: 7 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -9,91 +9,13 @@ on:
99
- 'prerelease-v[0-9]+.[0-9]+.[0-9]+**'
1010
jobs:
1111
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-latest, macos-13, macos-14, ubuntu-24.04-arm]
18-
19-
steps:
20-
- uses: actions/checkout@v4
21-
# aarch64 (arm) is built via qemu emulation
22-
# QEMU is sadly too slow. We need to wait for public ARM support
23-
#- name: Set up QEMU
24-
# if: runner.os == 'Linux'
25-
# uses: docker/setup-qemu-action@v3
26-
# with:
27-
# platforms: all
28-
- name: Build wheels
29-
uses: pypa/[email protected]
30-
env:
31-
CIBW_ARCHS_LINUX: auto
32-
with:
33-
package-dir: .
34-
output-dir: wheelhouse
35-
config-file: "{package}/pyproject.toml"
36-
- uses: actions/upload-artifact@v4
37-
with:
38-
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
39-
path: ./wheelhouse/*.whl
40-
41-
build_sdist:
42-
name: Build source distribution
43-
runs-on: ubuntu-latest
44-
steps:
45-
- uses: actions/checkout@v4
46-
47-
- name: Build sdist
48-
run: pipx run build --sdist
49-
- uses: actions/upload-artifact@v4
50-
with:
51-
name: cibw-sdist
52-
path: dist/*.tar.gz
53-
create_release:
54-
needs: [build_wheels, build_sdist]
55-
runs-on: ubuntu-latest
12+
uses: explosion/gha-cibuildwheel/.github/workflows/cibuildwheel.yml@main
5613
permissions:
5714
contents: write
58-
checks: write
5915
actions: read
60-
issues: read
61-
packages: write
62-
pull-requests: read
63-
repository-projects: read
64-
statuses: read
65-
steps:
66-
- name: Get the tag name and determine if it's a prerelease
67-
id: get_tag_info
68-
run: |
69-
FULL_TAG=${GITHUB_REF#refs/tags/}
70-
if [[ $FULL_TAG == release-* ]]; then
71-
TAG_NAME=${FULL_TAG#release-}
72-
IS_PRERELEASE=false
73-
elif [[ $FULL_TAG == prerelease-* ]]; then
74-
TAG_NAME=${FULL_TAG#prerelease-}
75-
IS_PRERELEASE=true
76-
else
77-
echo "Tag does not match expected patterns" >&2
78-
exit 1
79-
fi
80-
echo "FULL_TAG=$TAG_NAME" >> $GITHUB_ENV
81-
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
82-
echo "IS_PRERELEASE=$IS_PRERELEASE" >> $GITHUB_ENV
83-
- uses: actions/download-artifact@v4
84-
with:
85-
# unpacks all CIBW artifacts into dist/
86-
pattern: cibw-*
87-
path: dist
88-
merge-multiple: true
89-
- name: Create Draft Release
90-
id: create_release
91-
uses: softprops/action-gh-release@v2
92-
if: startsWith(github.ref, 'refs/tags/')
93-
env:
94-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95-
with:
96-
name: ${{ env.TAG_NAME }}
97-
draft: true
98-
prerelease: ${{ env.IS_PRERELEASE }}
99-
files: "./dist/*"
16+
with:
17+
wheel-name-pattern: "thinc-*.whl"
18+
pure-python: false
19+
secrets:
20+
gh-token: ${{ secrets.GITHUB_TOKEN }}
21+

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ build-backend = "setuptools.build_meta"
1212

1313
[tool.cibuildwheel]
1414
build = "*"
15-
skip = "pp* cp36* cp37* cp38* cp39* *-win32 *i686*"
15+
skip = "pp* cp38* cp39* *-win32 *i686*"
1616
test-skip = ""
1717
free-threaded-support = false
1818

0 commit comments

Comments
 (0)