-
-
Notifications
You must be signed in to change notification settings - Fork 120
95 lines (77 loc) · 2.61 KB
/
ci_py_release_test.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
name: PyPI Test Release
on: [push, pull_request]
jobs:
build_sdist:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: "pip"
- name: Build source distribution
run: |
pip3 install build twine
python3 -m build --sdist
- name: Upload files
uses: actions/upload-artifact@v3
with:
name: simplepyble
path: dist/*.tar.gz
- name: Check packages
run: twine check dist/*.tar.gz
- name: Publish packages
if: ${{ env.HAS_TWINE_USERNAME == 'true' }}
run: |
twine upload --repository testpypi --skip-existing dist/*.tar.gz --verbose
env:
HAS_TWINE_USERNAME: ${{ secrets.TEST_PYPI_USER != '' }}
TWINE_USERNAME: ${{ secrets.TEST_PYPI_USER }}
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
build_wheels:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04 , windows-2022, macos-12]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: "pip"
- name: Install dependencies
run: pip install -r simplepyble/requirements.txt
- name: Build wheel
uses: pypa/[email protected]
env:
CIBW_BUILD: cp39-* # Only build for Python 3.9
CIBW_BUILD_VERBOSITY: 3
CIBW_BEFORE_ALL_LINUX: "yum update -y && yum group install -y \"Development Tools\" && yum install -y dbus-devel"
CIBW_ARCHS_LINUX: x86_64 i686 aarch64
CIBW_ARCHS_MACOS: x86_64 universal2 arm64
CIBW_ARCHS_WINDOWS: AMD64 x86
CIBW_SKIP: "*musllinux_* pp*"
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: simpleble-wheels
path: wheelhouse/*.whl
- name: Check Packages
run: twine check wheelhouse/*.whl
- name: Publish packages
if: ${{ env.HAS_TWINE_USERNAME == 'true' }}
run: |
twine upload --repository testpypi --skip-existing wheelhouse/*.whl --verbose
env:
HAS_TWINE_USERNAME: ${{ secrets.TEST_PYPI_USER != '' }}
TWINE_USERNAME: ${{ secrets.TEST_PYPI_USER }}
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}