-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (84 loc) · 2.88 KB
/
Copy pathrelease.yml
File metadata and controls
94 lines (84 loc) · 2.88 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
name: Release
on:
push:
tags: ["v*"]
workflow_dispatch:
jobs:
build_wheels:
name: Wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
cibw_archs: "x86_64"
- os: ubuntu-24.04-arm
cibw_archs: "aarch64"
- os: macos-14
cibw_archs: "arm64"
- os: windows-latest
cibw_archs: "AMD64"
# macos-13 (Intel Mac, x86_64) is intentionally omitted: the
# GitHub-hosted macos-13 runner pool was saturated for ~45
# minutes during the v0.10.1 release attempt and eventually
# timed out. Apple Silicon has dominated new Mac sales for
# 4+ years; Intel Mac users install from the sdist
# (requires `brew install libomp` + C compiler via Xcode CLT).
# Re-enabling is one matrix entry.
steps:
- uses: actions/checkout@v6
- name: Build wheels
uses: pypa/cibuildwheel@v3.4
env:
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*"
CIBW_SKIP: "*-musllinux_* pp*"
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_BEFORE_ALL_MACOS: "brew install libomp"
# x86_64 wheels built on macos-13 can target 13.0. arm64
# wheels built on macos-14 must target 14.0 because Homebrew
# libomp on macos-14 is linked against macOS 14 system
# libraries -- delocate-wheel rejects the bundle with
# 'Library dependencies do not satisfy target MacOS version 13.0'
# when we try to target 13.
CIBW_ENVIRONMENT_MACOS: >-
MACOSX_DEPLOYMENT_TARGET=${{ matrix.os == 'macos-13' && '13.0' || '14.0' }}
CIBW_TEST_REQUIRES: "pytest hypothesis>=6.100"
CIBW_TEST_COMMAND: "pytest {project}/tests -q"
- uses: actions/upload-artifact@v7
with:
name: wheels-${{ matrix.os }}-${{ matrix.cibw_archs }}
path: ./wheelhouse/*.whl
build_sdist:
name: Source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Build sdist
run: |
python -m pip install --upgrade pip build
python -m build --sdist
- uses: actions/upload-artifact@v7
with:
name: sdist
path: dist/*.tar.gz
publish:
name: Publish to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
environment:
name: pypi
url: https://pypi.org/project/snapvec/
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v8
with:
path: dist
merge-multiple: true
- name: Publish via trusted publishing
uses: pypa/gh-action-pypi-publish@release/v1