-
Notifications
You must be signed in to change notification settings - Fork 1
186 lines (182 loc) · 5.4 KB
/
python_asyncio.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
name: Build Python AsyncIO
run-name: Python AsyncIO building
on: [push, pull_request]
permissions:
contents: write
pull-requests: read
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
jobs:
builds_linux:
strategy:
fail-fast: false
matrix:
archit: [x86_64, arm, aarch64]
include:
- archit: x86_64
target: x86_64-unknown-linux-gnu
- archit: arm
target: armv7-unknown-linux-gnueabihf
- archit: aarch64
target: aarch64-unknown-linux-gnu
runs-on: ubuntu-22.04
container: registry.cn-shanghai.aliyuncs.com/lebai/util:14.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
continue-on-error: true
- name: Install Cross Compiler
if: ${{ matrix.archit == 'arm'}}
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gcc-arm-linux-gnueabihf libc6-dev-armhf-cross
- name: Install Cross Compiler
if: ${{ matrix.archit == 'aarch64'}}
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gcc-aarch64-linux-gnu libc6-dev-arm64-cross
- name: Rename
uses: colathro/[email protected]
with:
file: "Cargo.toml"
key: "package.name"
value: "lebai_sdk_asyncio"
- name: Build
uses: PyO3/[email protected]
with:
container: off
manylinux: 2_17
command: build
args: --release --features ffi_py_asyncio,module,mdns --target ${{matrix.target}} --skip-auditwheel
- name: Upload
uses: actions/upload-artifact@v3
with:
name: Lebai_Python_AsyncIO_SDK_Linux_${{matrix.archit}}
path: ./target/wheels/*.whl
builds_macos:
strategy:
fail-fast: false
matrix:
archit: [x86_64, aarch64]
include:
- archit: x86_64
target: x86_64-apple-darwin
- archit: aarch64
target: aarch64-apple-darwin
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
continue-on-error: true
- name: Rename
uses: colathro/[email protected]
with:
file: "Cargo.toml"
key: "package.name"
value: "lebai_sdk_asyncio"
- name: Build
uses: PyO3/[email protected]
with:
container: off
command: build
args: --release --features ffi_py_asyncio,module,mdns --target ${{matrix.target}}
- name: Upload
uses: actions/upload-artifact@v3
with:
name: Lebai_Python_AsyncIO_SDK_MacOS_${{matrix.archit}}
path: ./target/wheels/*.whl
builds_windows:
strategy:
fail-fast: false
matrix:
archit: [x86_64]
include:
- archit: x86_64
target: x86_64-pc-windows-msvc
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
continue-on-error: true
- name: Rename
uses: colathro/[email protected]
with:
file: "Cargo.toml"
key: "package.name"
value: "lebai_sdk_asyncio"
- name: Build
uses: PyO3/[email protected]
with:
container: off
command: build
args: --release --features ffi_py_asyncio,module,mdns --target ${{matrix.target}}
- name: Upload
uses: actions/upload-artifact@v3
with:
name: Lebai_Python_AsyncIO_SDK_Windows_${{matrix.archit}}
path: ./target/wheels/*.whl
release:
if: ${{ contains(github.ref, 'tags/v') }}
needs: [builds_linux, builds_macos, builds_windows]
strategy:
fail-fast: false
runs-on: ubuntu-22.04
steps:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions/download-artifact@v3
- name: Release
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
uses: PyO3/[email protected]
with:
container: off
command: upload
args: --skip-existing */*.whl
- name: Zip Artifact
run: for dir in `ls`; do zip -r ${dir}.zip ${dir}; done
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: false
prerelease: false
files: |
*