-
-
Notifications
You must be signed in to change notification settings - Fork 2
149 lines (144 loc) · 4.82 KB
/
release.yml
File metadata and controls
149 lines (144 loc) · 4.82 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
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
138
139
140
141
142
143
144
145
146
147
148
149
name: Release
on:
push:
tags:
- release-v*
jobs:
create_macos_and_windows_wheels:
name: Wheels for Python ${{ matrix.python-version }} / ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
architecture: [x86, x64]
exclude:
- os: macos-latest
architecture: x86
- os: windows-latest
architecture: x86
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install Tox
run: pip install tox
- name: Build wheel
working-directory: ./
run: tox -e build-wheel
- uses: actions/upload-artifact@v2
with:
name: Distribution Artifacts
path: dist/
- name: Add Release File
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ./dist/*.whl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
create_wheels_manylinux:
name: Wheels for Python ${{ matrix.PYTHON_IMPLEMENTATION_ABI }} / Linux
strategy:
fail-fast: false
matrix:
# List of the language-implementation API pairs to publish wheels for
# The list of supported is obtainable by running `docker run quay.io/pypa/manylinux2014_x86_64 ls /opt/python`
PYTHON_IMPLEMENTATION_ABI: [cp37-cp37m, cp38-cp38, cp39-cp39, cp310-cp310]
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64 # Builds wheels on CentOS 7 (supported until 2024)
env:
# Variable needed for PyO3 to properly identify the python interpreter
PYTHON_SYS_EXECUTABLE: /opt/python/${{ matrix.PYTHON_IMPLEMENTATION_ABI }}/bin/python
steps:
- uses: actions/checkout@v2
- name: Install/Update OpenSSL
run: |
retryCount=0
# yum install seems to be flakey (due to network timeouts)
# retry up to 5 times with a 10s sleep in case of failure
until yum install openssl-devel --assumeyes --noplugins; do
# For some reason the install has failed
if [ ${retryCount} -eq 5 ]; then
false
else
retryCount=$((${retryCount}+1))
fi
sleep 10
done
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install Tox
run: ${{ env.PYTHON_SYS_EXECUTABLE }} -m pip install tox
- name: Build wheel
working-directory: ./
run: |
${{ env.PYTHON_SYS_EXECUTABLE }} -m tox -e build-wheel
# Ensure that the wheel is tagged as manylinux2014 platform
auditwheel repair \
--wheel-dir=./dist \
--plat manylinux2014_x86_64 \
./dist/peace_performance_python-*-${{ matrix.PYTHON_IMPLEMENTATION_ABI }}-linux_x86_64.whl
# Remove `linux_x86_64` tagged wheels as they are not supported by https://pypi.org
rm ./dist/peace_performance_python-*-${{ matrix.PYTHON_IMPLEMENTATION_ABI }}-linux_x86_64.whl
- uses: actions/upload-artifact@v2
with:
name: Distribution Artifacts
path: dist/
- name: Add Release File
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ./dist/*.whl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
create_source_dist:
name: Create sdist package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install Tox
run: pip install tox
- name: Build sdist
working-directory: ./
run: tox -e build-sdist
- uses: actions/upload-artifact@v2
with:
name: Distribution Artifacts
path: dist/
upload_to_pypi:
needs:
- create_macos_and_windows_wheels
- create_wheels_manylinux
- create_source_dist
name: Upload Artifacts to PyPi
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: Distribution Artifacts
path: dist/
- name: Publish distribution package to PyPI
uses: pypa/gh-action-pypi-publish@v1.2.2
with:
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}
packages_dir: dist/