-
Notifications
You must be signed in to change notification settings - Fork 21
137 lines (120 loc) · 4.07 KB
/
release.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
126
127
128
129
130
131
132
133
134
135
136
137
name: Build release
on:
push:
branches:
- master
tags:
- 'v*'
pull_request:
jobs:
cibuildwheel_py38plus:
name: Build python 3.8+ ${{ matrix.manylinux_image }} wheels
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-20.04 ]
python: ['3.10']
manylinux_image: [ manylinux2014, manylinux_2_28 ]
# Disable for platforms where pure Python wheels would be generated
cibw_skip: [pp38-*, pp39-*, pp310-*, pp311-*, cp312-*, pp312-*]
include:
# Exclude building 3.10+ wheels for manylinux1.
- os: ubuntu-20.04
python: 3.9
manylinux_image: manylinux1
cibw_skip: [pp38-*, pp39-*, pp310-*, cp310-*, pp311-*, cp311-*, cp312-*, pp312-*]
# Exclude building 3.11+ wheels for manylinux2010.
- os: ubuntu-20.04
python: '3.10'
manylinux_image: manylinux2010
cibw_skip: [pp38-*, pp39-*, pp310-*, pp311-*, cp311-*, cp312-*, pp312-*]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: ${{ matrix.python }}
- name: Install cibuildwheel
run: |
python -m pip install --upgrade pip cibuildwheel
- name: Set up QEMU
# For cross-architecture builds
# https://cibuildwheel.readthedocs.io/en/stable/faq/#emulation
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Set AArch64 env if needed
if: matrix.manylinux_image != 'manylinux1' && matrix.manylinux_image != 'manylinux2010'
env:
CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.manylinux_image }}
CIBW_ARCHS_LINUX: "auto aarch64"
run: echo "set CIBW_MANYLINUX_AARCH64_IMAGE=${{ env.CIBW_MANYLINUX_AARCH64_IMAGE }}"
- name: Build binary wheels
env:
CIBW_SKIP: ${{ matrix.cibw_skip }}
CIBW_BUILD_VERBOSITY: 1
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }}
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }}
run: python -m cibuildwheel
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
build_pure_wheels:
name: Build pure python wheels
runs-on: ubuntu-20.04
strategy:
matrix:
python: [3.9]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: ${{ matrix.python-version }}
- name: Install packaging tools
run: |
python -m pip install --upgrade pip setuptools wheel
- name: Build Python pure Python wheel
env:
SCOUT_DISABLE_EXTENSIONS: "1"
run: python setup.py bdist_wheel
- uses: actions/upload-artifact@v2
with:
path: dist/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: 3.9
- name: Build sdist
run: python setup.py sdist
- uses: actions/upload-artifact@v2
with:
path: dist/*.tar.gz
upload_pypi:
needs: [cibuildwheel_py38plus, build_pure_wheels, build_sdist]
runs-on: ubuntu-20.04
steps:
- name: Download distributions for publishing.
uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- name: Publish distributions to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_TWINE_PASSWORD }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
- name: Publish distributions to PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TWINE_PASSWORD }}