-
Notifications
You must be signed in to change notification settings - Fork 2
125 lines (123 loc) · 3.7 KB
/
pypi-push.yml
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Publish Python distributions to PyPI and TestPyPI
on:
push:
branches:
- "!*"
tags:
- "*"
jobs:
build-source-archive:
name: Build source archive (sdist)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
submodules: recursive
- name: build sdist
run: |
python3 setup.py sdist
- uses: actions/upload-artifact@v4
with:
name: source-archive
path: dist/*.tar.gz
build-manylinux-3_X:
name: Build manylinux wheels (Python3.X)
runs-on: ubuntu-latest
env:
CIBW_BUILD: '{cp,pp}3*x86_64'
CIBW_SKIP: '{cp,pp}3{6,7}*'
CIBW_MANYLINUX_X86_64_IMAGE: "jameseh96/manylinux2014_x86_64_conan"
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: "jameseh96/manylinux2014_x86_64_conan"
CIBW_MUSLLINUX_X86_64_IMAGE: "jameseh96/musllinux_1_1_x86_64_conan"
CIBW_MUSLLINUX_PYPY_X86_64_IMAGE: "jameseh96/musllinux_1_1_x86_64_conan"
steps:
- uses: actions/checkout@master
with:
submodules: recursive
- name: build wheels
uses: pypa/[email protected]
- uses: actions/upload-artifact@v4
with:
name: manylinux-3_X
path: wheelhouse/*.whl
build-mac-3_X:
name: Build mac wheels (Python3.X)
runs-on: macos-12
env:
CIBW_BUILD: '{cp,pp}3*x86_64'
CIBW_SKIP: '{cp,pp}3{6,7}*'
steps:
- uses: actions/checkout@master
with:
submodules: recursive
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.17.x'
- name: build wheels
uses: pypa/[email protected]
- uses: actions/upload-artifact@v4
with:
name: mac-3_X
path: wheelhouse/*.whl
build-mac-3_X-arm:
name: Build mac wheels (Python3.X + Arm)
runs-on: macos-12
env:
CONAN_MACOS_ARM64: "ON"
MACOSX_DEPLOYMENT_TARGET: "11"
CIBW_BUILD: '{cp,pp}3*arm64'
CIBW_SKIP: '{cp,pp}3{6,7}*'
CIBW_ARCHS_MACOS: 'arm64'
steps:
- uses: actions/checkout@master
with:
submodules: recursive
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.17.x'
- name: build wheels
uses: pypa/[email protected]
- uses: actions/upload-artifact@v4
with:
name: mac-3_X-arm
path: wheelhouse/*.whl
upload:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [build-source-archive, build-manylinux-3_X, build-mac-3_X, build-mac-3_X-arm]
steps:
- name: Create ./dist
run: mkdir ./dist
- uses: actions/download-artifact@v4
with:
name: source-archive
path: dist
- uses: actions/download-artifact@v4
with:
name: manylinux-3_X
path: dist
- uses: actions/download-artifact@v4
with:
name: mac-3_X
path: dist
- uses: actions/download-artifact@v4
with:
name: mac-3_X-arm
path: dist
- name: Publish distribution to Test PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}