-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (59 loc) · 1.7 KB
/
python-dist.yml
File metadata and controls
70 lines (59 loc) · 1.7 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
name: publish
on:
push:
tags:
- '*'
jobs:
tests:
uses: ./.github/workflows/unit-tests.yml
release-build:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
- os: macos-14 # arm64 + x86_64 via universal2
macos_deployment_target: "14.0"
- os: windows-latest
# Build and publish are gated on successful tests.
needs:
- tests
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
# Add -fopenmp for macOS builds to enable OpenMP support.
- name: Install OpenMP on macOS
if: runner.os == 'macOS'
run: brew install libomp
- name: Set MACOSX_DEPLOYMENT_TARGET for ARM builds
if: matrix.macos_deployment_target
run: echo "MACOSX_DEPLOYMENT_TARGET=${{ matrix.macos_deployment_target }}" >> "$GITHUB_ENV"
- name: Build wheels
uses: pypa/cibuildwheel@v3.4
with:
output-dir: dist
- uses: actions/upload-artifact@v7
with:
name: release-dists-${{ matrix.os }}
path: dist/
pypi-publish:
needs:
- release-build
environment:
name: publish
name: upload release to PyPI
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/download-artifact@v8
with:
pattern: release-dists-*
path: dist/
merge-multiple: true
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/