-
Notifications
You must be signed in to change notification settings - Fork 4
105 lines (90 loc) · 3.01 KB
/
python-package.yml
File metadata and controls
105 lines (90 loc) · 3.01 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
name: bgen
on:
push:
pull_request:
schedule:
- cron: "33 3 3 * *"
jobs:
default_tests:
name: test package
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-24.04-arm', 'ubuntu-latest', 'windows-latest']
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", '3.14']
steps:
- uses: actions/checkout@v5
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Build
run: |
python -m pip install --upgrade pip
pip install setuptools build
pip install .
python -m unittest discover
build_wheels:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-24.04-arm', 'ubuntu-latest', 'macos-latest', 'windows-latest']
python: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313", "cp314"]
steps:
- uses: actions/checkout@v5
with:
submodules: true
- name: Build wheels
uses: pypa/cibuildwheel@v3.2.1
env:
CIBW_BUILD: ${{ matrix.python }}-*
CIBW_SKIP: '*i686'
CIBW_TEST_COMMAND: "python -m unittest discover --verbose -s {project}"
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2014_x86_64:latest
CIBW_ARCHS: native
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: artifact-${{ matrix.os }}-${{ matrix.python }}
build_sdist:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.12'
- name: Build sdist
run: |
python -m pip install --upgrade pip
pip install setuptools build
python -m build --sdist
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
name: artifact-source
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
# alternatively, to publish when a GitHub Release is created, use the following rule:
# if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
with:
pattern: artifact-*
merge-multiple: true
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
# To test: repository_url: https://test.pypi.org/legacy/