-
Notifications
You must be signed in to change notification settings - Fork 2
100 lines (85 loc) · 2.74 KB
/
test_pypi.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
name: Build and deploy at test.PyPI
# Manually start test building
on:
push:
branches:
- 'main'
paths:
- setup.py
tags-ignore: # Don't trigger if not release
- '*'
workflow_dispatch:
jobs:
build_wheels:
name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }}
runs-on: ${{ matrix.buildplat[0] }}
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
buildplat:
- [ubuntu-latest, manylinux_x86_64]
- [macos-latest, macosx_x86_64]
- [macos-latest, macosx_arm64]
- [macos-latest, macosx_universal2]
- [windows-latest, win_amd64]
- [windows-latest, win32]
python: ["cp38", "cp39", "cp310", "cp311", "pp38"]
exclude:
# Don't build PyPy 32-bit windows
- buildplat: [windows-latest, win32]
python: "pp38"
- buildplat: [macos-latest, macosx_arm64]
python: "pp38"
- buildplat: [macos-latest, macosx_universal2]
python: "pp38"
- buildplat: [windows-latest, win32]
python: "cp310"
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.9' # update once build dependencies are available
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
CIBW_ARCHS: all
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}"
- uses: actions/upload-artifact@v3
with:
name: wheels_artifact
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v3
with:
name: source_artifact
path: dist/*.tar.gz
publish:
name: Publish on PyPI
runs-on: ubuntu-latest
needs: [build_wheels, build_sdist]
steps:
- uses: actions/download-artifact@v3
with:
name: wheels_artifact
path: dist
- uses: actions/download-artifact@v3
with:
name: source_artifact
path: dist
- name: Publish package
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true