Skip to content

Commit a1724ff

Browse files
authored
Add cibuildwheel actions (#111)
* Update pins and bump version * Remove old pythons * Remove Python3.9 * Set macos 13 * Reenable 3.9 * Fix pyproject * Fix build constraint * Try to add cibuildwheel workflow * Configure cibuildwheel * Remove macos 14 * Fix workflow * Update cibuildwheel config * Try to fix archs commands * Fix config * Skip pypy * Add another failure repro decorator * Temporarily try increasing error tolerance * Try to add more debugging * Comment * Try to get cibuildwheel uploading to pypi * Add fixed cibuildwheel workflow * Update action
1 parent dc0c6ef commit a1724ff

File tree

2 files changed

+45
-14
lines changed

2 files changed

+45
-14
lines changed

.github/workflows/cibuildwheel.yml

+19-14
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build
33
on:
44
release:
55
types:
6-
- published
6+
- created
77

88
jobs:
99
build_wheels:
@@ -25,7 +25,6 @@ jobs:
2525
package-dir: .
2626
output-dir: wheelhouse
2727
config-file: "{package}/pyproject.toml"
28-
2928
- uses: actions/upload-artifact@v4
3029
with:
3130
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
@@ -39,29 +38,35 @@ jobs:
3938

4039
- name: Build sdist
4140
run: pipx run build --sdist
42-
4341
- uses: actions/upload-artifact@v4
4442
with:
4543
name: cibw-sdist
4644
path: dist/*.tar.gz
47-
upload_pypi:
48-
needs: [build_wheels, build_sdist]
45+
# After the build has finished, download the artifacts from the action
46+
# and upload them to the release. When we publish the release, the
47+
# assets will be downloaded from it and uploaded to PyPi.
48+
upload_assets_to_release:
49+
needs: [build_sdist, build_wheels]
4950
runs-on: ubuntu-latest
50-
environment:
51-
name: pypi
52-
url: https://pypi.org/p/blis
5351
permissions:
54-
id-token: write
55-
if: github.event_name == 'release' && github.event.action == 'published'
56-
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
57-
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
52+
contents: write
53+
checks: write
54+
actions: read
55+
issues: read
56+
packages: write
57+
pull-requests: read
58+
repository-projects: read
59+
statuses: read
5860
steps:
5961
- uses: actions/download-artifact@v4
6062
with:
6163
# unpacks all CIBW artifacts into dist/
6264
pattern: cibw-*
6365
path: dist
6466
merge-multiple: true
65-
- uses: pypa/gh-action-pypi-publish@release/v1
67+
- uses: alexellis/[email protected]
68+
env:
69+
GITHUB_TOKEN: ${{ github.token }}
6670
with:
67-
repository-url: https://test.pypi.org/legacy/
71+
asset_paths: '["./dist/*"]'
72+

.github/workflows/publish_pypi.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# The cibuildwheel action triggers on creation of a release, this
2+
# triggers on publication.
3+
# The expected workflow is to create a draft release and let the wheels
4+
# upload, and then hit 'publish', which uploads to PyPi.
5+
6+
on:
7+
release:
8+
types:
9+
- published
10+
upload_pypi:
11+
needs: [build_wheels, build_sdist]
12+
runs-on: ubuntu-latest
13+
environment:
14+
name: pypi
15+
url: https://pypi.org/p/cymem
16+
permissions:
17+
id-token: write
18+
if: github.event_name == 'release' && github.event.action == 'published'
19+
steps:
20+
- uses: actions/download-artifact@v4
21+
with:
22+
# unpacks all CIBW artifacts into dist/
23+
pattern: cibw-*
24+
path: dist
25+
merge-multiple: true
26+
- uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)