-
Notifications
You must be signed in to change notification settings - Fork 365
81 lines (69 loc) · 2.35 KB
/
python-publish.yml
File metadata and controls
81 lines (69 loc) · 2.35 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
name: Upload Python Package to PyPI
on:
push:
tags: ["v*"]
permissions:
contents: read
jobs:
build_wheels:
name: Build wheels for cp${{ matrix.python-version }}-${{ matrix.os-platform[1] }}
runs-on: ${{ matrix.os-platform[0] }}
strategy:
fail-fast: false
matrix:
python-version: [310, 311, 312, 313]
os-platform:
[
[ubuntu-latest, manylinux_x86_64],
[ubuntu-latest, manylinux_aarch64],
[windows-latest, win_amd64],
[macos-13, macosx_x86_64],
[macos-14, macosx_arm64],
]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: "true"
- name: Set up QEMU
if: matrix.os-platform[1] == 'manylinux_aarch64'
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
with:
platforms: arm64
- name: Build wheels
uses: pypa/cibuildwheel@5f22145df44122af0f5a201f93cf0207171beca7 # v3.0.0
env:
CIBW_BUILD: cp${{ matrix.python-version }}-${{ matrix.os-platform[1] }}
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: artifact-cp${{ matrix.python-version }}-${{ matrix.os-platform[1] }}
path: wheelhouse/*.whl
retention-days: 1
build_sdist:
name: Build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: "true"
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.10"
- name: Build sdist
run: |
python -m pip install build
python -m build --sdist --outdir dist
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
path: dist/*.tar.gz
upload:
name: Upload to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4