This repository has been archived by the owner on Sep 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
97 lines (83 loc) · 2.59 KB
/
dist.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
# vim:ts=2:sw=2:et:ai:sts=2
name: 'Build and test wheels for release'
on:
release:
types: [created]
pull_request:
push:
branches:
- 'master'
- 'force_ci/all/**' # For development, forcing all workflows to run.
- 'force_ci/debian/**' # For debugging and/or only forcing this workflow.
jobs:
build_wheels:
name: 'Build and test wheels'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-11]
steps:
- uses: actions/checkout@v3
name: 'Checkout source repository'
with:
fetch-depth: 0
- name: Set up QEMU
if: runner.os == 'Linux' && github.event_name == 'release' && github.event.action == 'created'
uses: docker/setup-qemu-action@v2
with:
platforms: all
- uses: actions/setup-python@v4
name: 'Set up Python 3.11'
with:
python-version: '3.11'
- name: 'Install cibuildwheel'
run: |
python3 -m pip install cibuildwheel
- name: 'Build and test wheels'
env:
CIBW_ARCHS_MACOS: "x86_64 universal2 arm64"
CIBW_ARCHS_LINUX: auto aarch64
run: |
python3 -m cibuildwheel --output-dir dist
- uses: actions/upload-artifact@v2
name: 'Upload build artifacts'
if: github.event_name == 'release' && github.event.action == 'created'
with:
path: 'dist/*.whl'
build_sdist:
name: 'Build source distribution'
if: github.event_name == 'release' && github.event.action == 'created'
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v3
name: 'Checkout source repository'
with:
fetch-depth: 0
- uses: actions/setup-python@v4
name: 'Set up Python 3.10'
with:
python-version: '3.10'
- name: 'Build sdist'
run: >
pip3 install pkgconfig cython --upgrade &&
python3 setup.py sdist
- uses: actions/upload-artifact@v2
name: 'Upload build artifacts'
with:
path: 'dist/*.tar.gz'
upload_pypi:
name: 'Upload packages'
needs: ['build_wheels', 'build_sdist']
runs-on: 'ubuntu-latest'
if: github.event_name == 'release' && github.event.action == 'created'
steps:
- uses: actions/download-artifact@v2
name: 'Download artifacts'
with:
name: 'artifact'
path: 'dist'
- uses: pypa/gh-action-pypi-publish@release/v1
name: "Publish package to PyPI"
with:
user: '__token__'
password: '${{ secrets.PYPI_API_TOKEN }}'