-
Notifications
You must be signed in to change notification settings - Fork 8
99 lines (86 loc) · 3.14 KB
/
packages.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
name: packages
# When the 'permissions' key is specified, unspecified permission scopes (e.g.,
# actions, checks, etc.) are set to no access (none).
permissions:
contents: read
on:
workflow_dispatch:
inputs:
# When git-ref is empty, HEAD will be checked out.
git-ref:
description: Optional git ref (branch, tag, or full SHA)
required: false
jobs:
sdist:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Clone
uses: actions/checkout@v4
with:
# When the ref is empty, HEAD will be checked out.
ref: ${{ github.event.inputs.git-ref }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Dependencies
run: python -m pip install --upgrade pip setuptools
- name: Build
run: python setup.py sdist
- name: Upload
uses: actions/upload-artifact@v4
with:
name: packages-sdist
path: ./dist
wheels:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Use the oldest version of Ubuntu that supports the versions of Python
# you're targeting.
# > "Building manylinux-compatible wheels is not trivial; as a general
# rule, binaries built on one Linux distro will only work on other
# Linux distros that are the same age or newer. Therefore, if we
# want to make binaries that run on most Linux distros, we have to
# use a very old distro -- CentOS 6."
# - https://github.com/pypa/manylinux
os: [macos-latest, windows-latest, ubuntu-20.04]
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- name: Clone
uses: actions/checkout@v4
with:
# When the ref is empty, HEAD will be checked out.
ref: ${{ github.event.inputs.git-ref }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Dependencies
run: python -m pip install --upgrade pip setuptools wheel
- name: Build
run: python setup.py bdist_wheel
- name: manylinux
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
run: |
# Newer versions of auditwheel require a version of patchelf that's
# not available on Ubuntu 20.04.
# https://github.com/pypa/auditwheel/blob/main/CHANGELOG.md
# https://github.com/pypa/auditwheel/pull/403
# https://github.com/pypa/auditwheel/issues/401
python -m pip install --upgrade auditwheel==5.1.2
python -m auditwheel show dist/*.whl
# Use manylinux2014, as you can't use an older ABI because of the
# presence of too-recent versioned symbols. To target manylinux1 and/or
# manylinux2010, PyPA provides docker images.
python -m auditwheel repair --plat manylinux2014_x86_64 dist/*.whl
rm -r dist
mv wheelhouse dist
- name: Upload
uses: actions/upload-artifact@v4
with:
name: packages-wheels-${{ matrix.runs-on }}
path: ./dist