-
Notifications
You must be signed in to change notification settings - Fork 24
93 lines (80 loc) · 2.33 KB
/
release.yml
File metadata and controls
93 lines (80 loc) · 2.33 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
name: release
on:
release:
types: [published]
jobs:
build_sdist:
name: Build source
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.event.release.tag_name }}
- name: Build source
run: |
python -m pip install pip --upgrade
pip install build --upgrade
python -m build --sdist --outdir=wheelhouse
- name: Upload sdist to github
uses: actions/upload-artifact@v7
with:
name: wheels-sdist
path: wheelhouse/*.tar.gz
if-no-files-found: error
build_wheels:
name: Build wheel on ${{ matrix.os }} for ${{ matrix.cibw_archs }}
needs: [build_sdist]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
cibw_archs: "x86_64"
- os: ubuntu-24.04-arm
cibw_archs: "auto"
- os: windows-2022
cibw_archs: "auto64"
# macos-15-intel for Intel and maos-latest for Apple Silicon
- os: macos-15-intel
cibw_archs: "x86_64"
- os: macos-latest
cibw_archs: "arm64"
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.event.release.tag_name }}
- name: Build wheels
uses: pypa/cibuildwheel@v3.4
with:
config-file: cibuildwheel.toml
output-dir: wheelhouse
env:
CIBW_ENVIRONMENT_MACOS: CMAKE_OSX_ARCHITECTURES=${{ matrix.cibw_archs }}
- name: Upload artifacts to github
uses: actions/upload-artifact@v7
with:
name: wheels-${{ runner.os }}-${{ matrix.cibw_archs }}
path: ./wheelhouse/*.whl
if-no-files-found: error
publish_to_pypi:
name: Publish wheels to PyPi
needs: [build_sdist, build_wheels]
runs-on: ubuntu-latest
# https://docs.pypi.org/trusted-publishers/using-a-publisher/
environment: publish
permissions:
id-token: write
steps:
- name: Download packages
uses: actions/download-artifact@v8
with:
pattern: wheels-*
path: dist
merge-multiple: true
- name: Print out packages
run: ls -la dist/*
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1