forked from msoos/cryptominisat
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (66 loc) · 2.32 KB
/
python-wheels.yml
File metadata and controls
76 lines (66 loc) · 2.32 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
name: Build and publish Python wheels
on:
push:
branches: ["master"]
tags:
- 'release/v[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches: ["*"]
workflow_dispatch: # allow manual test-runs without a tag
jobs:
build_wheels:
name: Wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
# Each runner builds for its native architecture.
# Linux aarch64 uses a native ARM GitHub-hosted runner.
os: [ubuntu-latest, ubuntu-24.04-arm, macos-14, macos-15-intel]
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Install GMP (macOS)
if: contains(matrix.os, 'macos')
run: |
brew install gmp || true
- name: Cache ccache
uses: actions/cache@v4
with:
# Linux builds happen inside Docker; ccache dir is set to /project/.ccache
# (= .ccache relative to the checkout) so the host can cache it.
# macOS builds are native; ccache uses ~/.ccache by default.
path: |
.ccache
~/.ccache
key: ccache-${{ matrix.os }}-${{ github.sha }}
restore-keys: ccache-${{ matrix.os }}-
- name: Build wheels
uses: pypa/cibuildwheel@v3.1.0
# All cibuildwheel settings live in [tool.cibuildwheel] in pyproject.toml.
# The only per-runner override needed is the arch selector:
env:
CIBW_ARCHS_LINUX: native # x86_64 on ubuntu-latest, aarch64 on ubuntu-24.04-arm
CIBW_ARCHS_MACOS: native # arm64 on macos-14, x86_64 on macos-15-intel
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: wheelhouse/*.whl
publish:
name: Publish to PyPI
needs: build_wheels
runs-on: ubuntu-latest
# Publish on release tags (release/v...); not on branch pushes or workflow_dispatch.
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/release/v')
environment: pypi
permissions:
id-token: write # required for OIDC trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1