-
Notifications
You must be signed in to change notification settings - Fork 12
97 lines (87 loc) · 2.48 KB
/
create_wheels.yaml
File metadata and controls
97 lines (87 loc) · 2.48 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
name: Build
on:
workflow_dispatch:
push:
branches: [ master ]
tags:
- v*
pull_request:
branches: [ master ]
jobs:
build-wheels:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: [37, 38, 39, 310, 311]
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Setup rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Build wheels
uses: pypa/cibuildwheel@v2.11.3
env:
CIBW_BUILD: cp${{matrix.python-version}}-*
CIBW_ENVIRONMENT: 'PATH="$HOME/.cargo/bin:$PATH" CARGO_TERM_COLOR="always"'
CIBW_ENVIRONMENT_WINDOWS: 'PATH="$UserProfile\.cargo\bin;$PATH"'
- name: Upload Binaries
uses: actions/upload-artifact@v3
with:
name: wheels
path: wheelhouse
test-wheels:
needs: [build-wheels]
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, '3.10', '3.11']
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v3
with:
path: py_cpp_demangle_source
- uses: actions/download-artifact@v3
with:
name: wheels
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install wheel
run: |
pip install --force-reinstall --no-deps --no-index --find-links . cpp-demangle
- name: Run unittests
run: |
python -m unittest discover py_cpp_demangle_source/tests
release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [test-wheels]
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
- name: Create GitHub Release
uses: fnkr/github-action-ghr@v1.3
env:
GHR_PATH: .
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Push to PyPi
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
pip install --upgrade wheel pip setuptools twine
twine upload *
rm *