-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (46 loc) · 1.56 KB
/
build-publish-pypi.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
name: Build Test and Publish
on: [push, pull_request,release,workflow_dispatch]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macOS-11]
steps:
- uses: actions/checkout@v4
# Used to host cibuildwheel
- uses: actions/setup-python@v3
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.16.2
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
# to supply options, put them in 'env', like:
env:
# CIBW_SOME_OPTION: value
# remove python 3.12 and pp
CIBW_SKIP: "cp27-* cp35-* cp36-* cp312-* pp* *-win32 *win_arm64 *i686 *musllinux*"
CIBW_BEFORE_ALL_WINDOWS: >
vcpkg update &&
vcpkg install getopt:x64-windows-static &&
vcpkg integrate install
CIBW_TEST_COMMAND: "python {project}/docs/tutorial/example.py"
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
upload_all:
needs: [build_wheels]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- name: List directory contents
run: |
ls -l ./dist
- uses: pypa/gh-action-pypi-publish@v1.4.1
with:
user: __token__
password: ${{ secrets.PIPYTOKEN }}