hardware-address 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hardware_address-0.2.0/.codecov.yml +28 -0
- hardware_address-0.2.0/.github/FUNDING.yml +3 -0
- hardware_address-0.2.0/.github/dependabot.yml +13 -0
- hardware_address-0.2.0/.github/workflows/ci.yml +222 -0
- hardware_address-0.2.0/.github/workflows/loc.yml +58 -0
- hardware_address-0.2.0/.github/workflows/python.yml +214 -0
- hardware_address-0.2.0/.github/workflows/wasm.yml +115 -0
- hardware_address-0.2.0/.gitignore +41 -0
- hardware_address-0.2.0/CHANGELOG.md +82 -0
- hardware_address-0.2.0/Cargo.lock +442 -0
- hardware_address-0.2.0/Cargo.toml +47 -0
- hardware_address-0.2.0/LICENSE-APACHE +201 -0
- hardware_address-0.2.0/LICENSE-MIT +25 -0
- hardware_address-0.2.0/PKG-INFO +247 -0
- hardware_address-0.2.0/README.md +181 -0
- hardware_address-0.2.0/README.pypi.md +213 -0
- hardware_address-0.2.0/build.rs +31 -0
- hardware_address-0.2.0/examples/custom.rs +13 -0
- hardware_address-0.2.0/pyproject.toml +56 -0
- hardware_address-0.2.0/python/.gitignore +72 -0
- hardware_address-0.2.0/python/Cargo.toml +18 -0
- hardware_address-0.2.0/python/README.md +209 -0
- hardware_address-0.2.0/python/README.pypi.md +213 -0
- hardware_address-0.2.0/python/build.rs +3 -0
- hardware_address-0.2.0/python/src/lib.rs +11 -0
- hardware_address-0.2.0/python/test.sh +42 -0
- hardware_address-0.2.0/python/tests/__init__.py +1 -0
- hardware_address-0.2.0/python/tests/test_hardware_address.py +171 -0
- hardware_address-0.2.0/rustfmt.toml +13 -0
- hardware_address-0.2.0/src/arbitrary.rs +27 -0
- hardware_address-0.2.0/src/eui64.rs +173 -0
- hardware_address-0.2.0/src/infini_band.rs +189 -0
- hardware_address-0.2.0/src/lib.rs +628 -0
- hardware_address-0.2.0/src/mac.rs +178 -0
- hardware_address-0.2.0/src/py.rs +135 -0
- hardware_address-0.2.0/src/quickcheck.rs +32 -0
- hardware_address-0.2.0/src/wasm.rs +115 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
codecov:
|
|
2
|
+
require_ci_to_pass: false
|
|
3
|
+
|
|
4
|
+
ignore:
|
|
5
|
+
- examples/
|
|
6
|
+
- python/
|
|
7
|
+
- src/py.rs
|
|
8
|
+
- src/wasm.rs
|
|
9
|
+
- src/quickcheck.rs
|
|
10
|
+
- src/arbitrary.rs
|
|
11
|
+
coverage:
|
|
12
|
+
status:
|
|
13
|
+
project: # Overall project status
|
|
14
|
+
default:
|
|
15
|
+
target: auto
|
|
16
|
+
if_not_found: success
|
|
17
|
+
only_pulls: false
|
|
18
|
+
patch: # Status for the patch in pull requests
|
|
19
|
+
default:
|
|
20
|
+
target: auto
|
|
21
|
+
if_not_found: success
|
|
22
|
+
only_pulls: true
|
|
23
|
+
changes: false # Whether to comment on the coverage changes in pull requests
|
|
24
|
+
|
|
25
|
+
comment:
|
|
26
|
+
layout: "header, diff, files, footer"
|
|
27
|
+
behavior: default
|
|
28
|
+
require_changes: false
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: "cargo"
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: "weekly"
|
|
7
|
+
open-pull-requests-limit: 50
|
|
8
|
+
|
|
9
|
+
- package-ecosystem: "github-actions"
|
|
10
|
+
directory: "/"
|
|
11
|
+
schedule:
|
|
12
|
+
# Check for updates to GitHub Actions every weekday
|
|
13
|
+
interval: "daily"
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
paths-ignore:
|
|
8
|
+
- 'README'
|
|
9
|
+
- 'COPYRIGHT'
|
|
10
|
+
- 'LICENSE-*'
|
|
11
|
+
- '**.md'
|
|
12
|
+
- '**.txt'
|
|
13
|
+
pull_request:
|
|
14
|
+
paths-ignore:
|
|
15
|
+
- 'README'
|
|
16
|
+
- 'COPYRIGHT'
|
|
17
|
+
- 'LICENSE-*'
|
|
18
|
+
- '**.md'
|
|
19
|
+
- '**.txt'
|
|
20
|
+
workflow_dispatch:
|
|
21
|
+
schedule: [cron: "0 1 */7 * *"]
|
|
22
|
+
|
|
23
|
+
env:
|
|
24
|
+
CARGO_TERM_COLOR: always
|
|
25
|
+
RUSTFLAGS: -Dwarnings
|
|
26
|
+
RUST_BACKTRACE: 1
|
|
27
|
+
nightly: nightly
|
|
28
|
+
stable: stable
|
|
29
|
+
|
|
30
|
+
jobs:
|
|
31
|
+
# Check formatting
|
|
32
|
+
rustfmt:
|
|
33
|
+
name: rustfmt
|
|
34
|
+
strategy:
|
|
35
|
+
matrix:
|
|
36
|
+
os:
|
|
37
|
+
- ubuntu-latest
|
|
38
|
+
- macos-latest
|
|
39
|
+
- windows-latest
|
|
40
|
+
runs-on: ${{ matrix.os }}
|
|
41
|
+
steps:
|
|
42
|
+
- uses: actions/checkout@v4
|
|
43
|
+
- name: Install Rust
|
|
44
|
+
# --no-self-update is necessary because the windows environment cannot self-update rustup.exe.
|
|
45
|
+
run: rustup update stable --no-self-update && rustup default stable
|
|
46
|
+
- name: Check formatting
|
|
47
|
+
run: cargo fmt --all -- --check
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
# Apply clippy lints
|
|
51
|
+
clippy:
|
|
52
|
+
name: clippy
|
|
53
|
+
strategy:
|
|
54
|
+
matrix:
|
|
55
|
+
os:
|
|
56
|
+
- ubuntu-latest
|
|
57
|
+
- macos-latest
|
|
58
|
+
- windows-latest
|
|
59
|
+
runs-on: ${{ matrix.os }}
|
|
60
|
+
steps:
|
|
61
|
+
- uses: actions/checkout@v4
|
|
62
|
+
- name: Install Rust
|
|
63
|
+
# --no-self-update is necessary because the windows environment cannot self-update rustup.exe.
|
|
64
|
+
run: rustup update stable --no-self-update && rustup default stable
|
|
65
|
+
- name: Install cargo-hack
|
|
66
|
+
run: cargo install cargo-hack
|
|
67
|
+
- name: Apply clippy lints
|
|
68
|
+
run: cargo hack clippy --each-feature --exclude-no-default-features
|
|
69
|
+
|
|
70
|
+
# Run tests on some extra platforms
|
|
71
|
+
cross:
|
|
72
|
+
name: cross
|
|
73
|
+
strategy:
|
|
74
|
+
matrix:
|
|
75
|
+
target:
|
|
76
|
+
- aarch64-unknown-linux-gnu
|
|
77
|
+
- aarch64-linux-android
|
|
78
|
+
- aarch64-unknown-linux-musl
|
|
79
|
+
- i686-linux-android
|
|
80
|
+
- x86_64-linux-android
|
|
81
|
+
- i686-pc-windows-gnu
|
|
82
|
+
- x86_64-pc-windows-gnu
|
|
83
|
+
- i686-unknown-linux-gnu
|
|
84
|
+
- powerpc64-unknown-linux-gnu
|
|
85
|
+
# - mips64-unknown-linux-gnuabi64
|
|
86
|
+
- riscv64gc-unknown-linux-gnu
|
|
87
|
+
- wasm32-unknown-unknown
|
|
88
|
+
- wasm32-unknown-emscripten
|
|
89
|
+
- wasm32-wasip1
|
|
90
|
+
- wasm32-wasip1-threads
|
|
91
|
+
- wasm32-wasip2
|
|
92
|
+
runs-on: ubuntu-latest
|
|
93
|
+
steps:
|
|
94
|
+
- uses: actions/checkout@v4
|
|
95
|
+
- name: Cache cargo build and registry
|
|
96
|
+
uses: actions/cache@v4
|
|
97
|
+
with:
|
|
98
|
+
path: |
|
|
99
|
+
~/.cargo/registry
|
|
100
|
+
~/.cargo/git
|
|
101
|
+
target
|
|
102
|
+
key: ${{ runner.os }}-cross-${{ hashFiles('**/Cargo.lock') }}
|
|
103
|
+
restore-keys: |
|
|
104
|
+
${{ runner.os }}-cross-
|
|
105
|
+
- name: Install Rust
|
|
106
|
+
run: rustup update stable && rustup default stable
|
|
107
|
+
- name: cargo build --target ${{ matrix.target }}
|
|
108
|
+
run: |
|
|
109
|
+
rustup target add ${{ matrix.target }}
|
|
110
|
+
cargo build --target ${{ matrix.target }}
|
|
111
|
+
|
|
112
|
+
build:
|
|
113
|
+
name: build
|
|
114
|
+
strategy:
|
|
115
|
+
matrix:
|
|
116
|
+
os:
|
|
117
|
+
- ubuntu-latest
|
|
118
|
+
- macos-latest
|
|
119
|
+
- windows-latest
|
|
120
|
+
runs-on: ${{ matrix.os }}
|
|
121
|
+
steps:
|
|
122
|
+
- uses: actions/checkout@v4
|
|
123
|
+
- name: Cache cargo build and registry
|
|
124
|
+
uses: actions/cache@v4
|
|
125
|
+
with:
|
|
126
|
+
path: |
|
|
127
|
+
~/.cargo/registry
|
|
128
|
+
~/.cargo/git
|
|
129
|
+
target
|
|
130
|
+
key: ${{ runner.os }}-build-${{ hashFiles('**/Cargo.lock') }}
|
|
131
|
+
restore-keys: |
|
|
132
|
+
${{ runner.os }}-build-
|
|
133
|
+
- name: Install Rust
|
|
134
|
+
# --no-self-update is necessary because the windows environment cannot self-update rustup.exe.
|
|
135
|
+
run: rustup update stable --no-self-update && rustup default stable
|
|
136
|
+
- name: Install cargo-hack
|
|
137
|
+
run: cargo install cargo-hack
|
|
138
|
+
- name: Cache ~/.cargo
|
|
139
|
+
uses: actions/cache@v4
|
|
140
|
+
with:
|
|
141
|
+
path: ~/.cargo
|
|
142
|
+
key: ${{ runner.os }}-coverage-dotcargo
|
|
143
|
+
- name: Run build
|
|
144
|
+
run: cargo hack build --feature-powerset --exclude-no-default-features
|
|
145
|
+
|
|
146
|
+
test:
|
|
147
|
+
name: test
|
|
148
|
+
strategy:
|
|
149
|
+
matrix:
|
|
150
|
+
os:
|
|
151
|
+
- ubuntu-latest
|
|
152
|
+
- macos-latest
|
|
153
|
+
- windows-latest
|
|
154
|
+
runs-on: ${{ matrix.os }}
|
|
155
|
+
steps:
|
|
156
|
+
- uses: actions/checkout@v4
|
|
157
|
+
- name: Cache cargo build and registry
|
|
158
|
+
uses: actions/cache@v4
|
|
159
|
+
with:
|
|
160
|
+
path: |
|
|
161
|
+
~/.cargo/registry
|
|
162
|
+
~/.cargo/git
|
|
163
|
+
target
|
|
164
|
+
key: ${{ runner.os }}-test-${{ hashFiles('**/Cargo.lock') }}
|
|
165
|
+
restore-keys: |
|
|
166
|
+
${{ runner.os }}-test-
|
|
167
|
+
- name: Install Rust
|
|
168
|
+
# --no-self-update is necessary because the windows environment cannot self-update rustup.exe.
|
|
169
|
+
run: rustup update stable --no-self-update && rustup default stable
|
|
170
|
+
- name: Install cargo-hack
|
|
171
|
+
run: cargo install cargo-hack
|
|
172
|
+
- name: Cache ~/.cargo
|
|
173
|
+
uses: actions/cache@v4
|
|
174
|
+
with:
|
|
175
|
+
path: ~/.cargo
|
|
176
|
+
key: ${{ runner.os }}-coverage-dotcargo
|
|
177
|
+
- name: Run test
|
|
178
|
+
run: cargo hack test --feature-powerset --exclude-no-default-features
|
|
179
|
+
|
|
180
|
+
coverage:
|
|
181
|
+
name: coverage
|
|
182
|
+
runs-on: ubuntu-latest
|
|
183
|
+
needs:
|
|
184
|
+
- rustfmt
|
|
185
|
+
- clippy
|
|
186
|
+
- build
|
|
187
|
+
- cross
|
|
188
|
+
- test
|
|
189
|
+
steps:
|
|
190
|
+
- uses: actions/checkout@v4
|
|
191
|
+
- name: Install latest nightly
|
|
192
|
+
uses: actions-rs/toolchain@v1
|
|
193
|
+
with:
|
|
194
|
+
toolchain: nightly
|
|
195
|
+
override: true
|
|
196
|
+
- uses: actions-rs/install@v0.1
|
|
197
|
+
with:
|
|
198
|
+
crate: cargo-tarpaulin
|
|
199
|
+
version: latest
|
|
200
|
+
- name: Cache ~/.cargo
|
|
201
|
+
uses: actions/cache@v4
|
|
202
|
+
with:
|
|
203
|
+
path: ~/.cargo
|
|
204
|
+
key: ${{ runner.os }}-coverage-dotcargo
|
|
205
|
+
- name: Cache cargo build
|
|
206
|
+
uses: actions/cache@v4
|
|
207
|
+
with:
|
|
208
|
+
path: target
|
|
209
|
+
key: ${{ runner.os }}-coverage-cargo-build-target
|
|
210
|
+
- name: Run tarpaulin
|
|
211
|
+
uses: actions-rs/cargo@v1
|
|
212
|
+
env:
|
|
213
|
+
RUSTFLAGS: "--cfg tarpaulin"
|
|
214
|
+
with:
|
|
215
|
+
command: tarpaulin
|
|
216
|
+
args: --features serde --run-types tests --run-types doctests -p hardware-address --out xml
|
|
217
|
+
- name: Upload to codecov.io
|
|
218
|
+
uses: codecov/codecov-action@v5
|
|
219
|
+
with:
|
|
220
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
221
|
+
slug: ${{ github.repository }}
|
|
222
|
+
fail_ci_if_error: true
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
name: loc
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
paths-ignore:
|
|
8
|
+
- 'README.md'
|
|
9
|
+
- 'COPYRIGHT'
|
|
10
|
+
- 'LICENSE*'
|
|
11
|
+
- '**.md'
|
|
12
|
+
- '**.txt'
|
|
13
|
+
- 'art'
|
|
14
|
+
pull_request:
|
|
15
|
+
paths-ignore:
|
|
16
|
+
- 'README.md'
|
|
17
|
+
- 'COPYRIGHT'
|
|
18
|
+
- 'LICENSE*'
|
|
19
|
+
- '**.md'
|
|
20
|
+
- '**.txt'
|
|
21
|
+
- 'art'
|
|
22
|
+
workflow_dispatch:
|
|
23
|
+
|
|
24
|
+
jobs:
|
|
25
|
+
loc:
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@v4
|
|
29
|
+
|
|
30
|
+
- name: Install Rust
|
|
31
|
+
run: |
|
|
32
|
+
rustup update stable && rustup default stable
|
|
33
|
+
rustup component add clippy
|
|
34
|
+
rustup component add rustfmt
|
|
35
|
+
|
|
36
|
+
- name: Install tokeit
|
|
37
|
+
run: |
|
|
38
|
+
cargo install tokeit --force
|
|
39
|
+
|
|
40
|
+
- name: Count total lines of code
|
|
41
|
+
run: |
|
|
42
|
+
tokeit
|
|
43
|
+
- name: Upload total loc to GitHub Gist
|
|
44
|
+
uses: actions/github-script@v7
|
|
45
|
+
with:
|
|
46
|
+
github-token: ${{ secrets.GIST_PAT }}
|
|
47
|
+
script: |
|
|
48
|
+
const fs = require('fs');
|
|
49
|
+
const output = fs.readFileSync('tokeit.json', 'utf8');
|
|
50
|
+
const gistId = '327b2a8aef9003246e45c6e47fe63937';
|
|
51
|
+
await github.rest.gists.update({
|
|
52
|
+
gist_id: gistId,
|
|
53
|
+
files: {
|
|
54
|
+
"hardware-address": {
|
|
55
|
+
content: output
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
# This file is autogenerated by maturin v1.9.6
|
|
2
|
+
# To update, run
|
|
3
|
+
#
|
|
4
|
+
# maturin generate-ci github
|
|
5
|
+
#
|
|
6
|
+
name: Python
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
push:
|
|
10
|
+
branches:
|
|
11
|
+
- main
|
|
12
|
+
- master
|
|
13
|
+
tags:
|
|
14
|
+
- '*'
|
|
15
|
+
pull_request:
|
|
16
|
+
workflow_dispatch:
|
|
17
|
+
|
|
18
|
+
permissions:
|
|
19
|
+
contents: read
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
test:
|
|
23
|
+
name: Test Python Package
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v4
|
|
27
|
+
- uses: actions/setup-python@v5
|
|
28
|
+
with:
|
|
29
|
+
python-version: '3.11'
|
|
30
|
+
- name: Install Rust
|
|
31
|
+
uses: dtolnay/rust-toolchain@stable
|
|
32
|
+
- name: Build and test
|
|
33
|
+
working-directory: python
|
|
34
|
+
run: |
|
|
35
|
+
chmod +x test.sh
|
|
36
|
+
./test.sh
|
|
37
|
+
|
|
38
|
+
linux:
|
|
39
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
40
|
+
strategy:
|
|
41
|
+
matrix:
|
|
42
|
+
platform:
|
|
43
|
+
- runner: ubuntu-22.04
|
|
44
|
+
target: x86_64
|
|
45
|
+
- runner: ubuntu-22.04
|
|
46
|
+
target: x86
|
|
47
|
+
- runner: ubuntu-22.04
|
|
48
|
+
target: aarch64
|
|
49
|
+
- runner: ubuntu-22.04
|
|
50
|
+
target: armv7
|
|
51
|
+
- runner: ubuntu-22.04
|
|
52
|
+
target: s390x
|
|
53
|
+
- runner: ubuntu-22.04
|
|
54
|
+
target: ppc64le
|
|
55
|
+
steps:
|
|
56
|
+
- uses: actions/checkout@v4
|
|
57
|
+
- uses: actions/setup-python@v5
|
|
58
|
+
with:
|
|
59
|
+
python-version: 3.x
|
|
60
|
+
- name: Build wheels
|
|
61
|
+
uses: PyO3/maturin-action@v1
|
|
62
|
+
with:
|
|
63
|
+
target: ${{ matrix.platform.target }}
|
|
64
|
+
args: --release --out dist --find-interpreter
|
|
65
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
66
|
+
manylinux: auto
|
|
67
|
+
working-directory: python
|
|
68
|
+
- name: Upload wheels
|
|
69
|
+
uses: actions/upload-artifact@v4
|
|
70
|
+
with:
|
|
71
|
+
name: wheels-linux-${{ matrix.platform.target }}
|
|
72
|
+
path: python/dist
|
|
73
|
+
|
|
74
|
+
musllinux:
|
|
75
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
76
|
+
strategy:
|
|
77
|
+
matrix:
|
|
78
|
+
platform:
|
|
79
|
+
- runner: ubuntu-22.04
|
|
80
|
+
target: x86_64
|
|
81
|
+
- runner: ubuntu-22.04
|
|
82
|
+
target: x86
|
|
83
|
+
- runner: ubuntu-22.04
|
|
84
|
+
target: aarch64
|
|
85
|
+
- runner: ubuntu-22.04
|
|
86
|
+
target: armv7
|
|
87
|
+
steps:
|
|
88
|
+
- uses: actions/checkout@v4
|
|
89
|
+
- uses: actions/setup-python@v5
|
|
90
|
+
with:
|
|
91
|
+
python-version: 3.x
|
|
92
|
+
- name: Build wheels
|
|
93
|
+
uses: PyO3/maturin-action@v1
|
|
94
|
+
with:
|
|
95
|
+
target: ${{ matrix.platform.target }}
|
|
96
|
+
args: --release --out dist --find-interpreter
|
|
97
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
98
|
+
manylinux: musllinux_1_2
|
|
99
|
+
working-directory: python
|
|
100
|
+
- name: Upload wheels
|
|
101
|
+
uses: actions/upload-artifact@v4
|
|
102
|
+
with:
|
|
103
|
+
name: wheels-musllinux-${{ matrix.platform.target }}
|
|
104
|
+
path: python/dist
|
|
105
|
+
|
|
106
|
+
windows:
|
|
107
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
108
|
+
strategy:
|
|
109
|
+
matrix:
|
|
110
|
+
platform:
|
|
111
|
+
- runner: windows-latest
|
|
112
|
+
target: x64
|
|
113
|
+
- runner: windows-latest
|
|
114
|
+
target: x86
|
|
115
|
+
steps:
|
|
116
|
+
- uses: actions/checkout@v4
|
|
117
|
+
- uses: actions/setup-python@v5
|
|
118
|
+
with:
|
|
119
|
+
python-version: 3.x
|
|
120
|
+
architecture: ${{ matrix.platform.target }}
|
|
121
|
+
- name: Build wheels
|
|
122
|
+
uses: PyO3/maturin-action@v1
|
|
123
|
+
with:
|
|
124
|
+
target: ${{ matrix.platform.target }}
|
|
125
|
+
args: --release --out dist --find-interpreter
|
|
126
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
127
|
+
working-directory: python
|
|
128
|
+
- name: Upload wheels
|
|
129
|
+
uses: actions/upload-artifact@v4
|
|
130
|
+
with:
|
|
131
|
+
name: wheels-windows-${{ matrix.platform.target }}
|
|
132
|
+
path: python/dist
|
|
133
|
+
|
|
134
|
+
macos:
|
|
135
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
136
|
+
strategy:
|
|
137
|
+
matrix:
|
|
138
|
+
platform:
|
|
139
|
+
- runner: macos-13
|
|
140
|
+
target: x86_64
|
|
141
|
+
- runner: macos-14
|
|
142
|
+
target: aarch64
|
|
143
|
+
steps:
|
|
144
|
+
- uses: actions/checkout@v4
|
|
145
|
+
- uses: actions/setup-python@v5
|
|
146
|
+
with:
|
|
147
|
+
python-version: 3.x
|
|
148
|
+
- name: Build wheels
|
|
149
|
+
uses: PyO3/maturin-action@v1
|
|
150
|
+
with:
|
|
151
|
+
target: ${{ matrix.platform.target }}
|
|
152
|
+
args: --release --out dist --find-interpreter
|
|
153
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
154
|
+
working-directory: python
|
|
155
|
+
- name: Upload wheels
|
|
156
|
+
uses: actions/upload-artifact@v4
|
|
157
|
+
with:
|
|
158
|
+
name: wheels-macos-${{ matrix.platform.target }}
|
|
159
|
+
path: python/dist
|
|
160
|
+
|
|
161
|
+
sdist:
|
|
162
|
+
runs-on: ubuntu-latest
|
|
163
|
+
steps:
|
|
164
|
+
- uses: actions/checkout@v4
|
|
165
|
+
- name: Build sdist
|
|
166
|
+
uses: PyO3/maturin-action@v1
|
|
167
|
+
with:
|
|
168
|
+
command: sdist
|
|
169
|
+
args: --out dist
|
|
170
|
+
working-directory: python
|
|
171
|
+
- name: Upload sdist
|
|
172
|
+
uses: actions/upload-artifact@v4
|
|
173
|
+
with:
|
|
174
|
+
name: wheels-sdist
|
|
175
|
+
path: python/dist
|
|
176
|
+
|
|
177
|
+
release:
|
|
178
|
+
name: Release
|
|
179
|
+
runs-on: ubuntu-latest
|
|
180
|
+
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
|
|
181
|
+
needs: [test, linux, musllinux, windows, macos, sdist]
|
|
182
|
+
permissions:
|
|
183
|
+
# Use to sign the release artifacts
|
|
184
|
+
id-token: write
|
|
185
|
+
# Used to upload release artifacts
|
|
186
|
+
contents: write
|
|
187
|
+
# Used to generate artifact attestation
|
|
188
|
+
attestations: write
|
|
189
|
+
steps:
|
|
190
|
+
- uses: actions/checkout@v4
|
|
191
|
+
|
|
192
|
+
- name: Download all artifacts
|
|
193
|
+
uses: actions/download-artifact@v4
|
|
194
|
+
with:
|
|
195
|
+
path: dist
|
|
196
|
+
pattern: wheels-*
|
|
197
|
+
merge-multiple: true
|
|
198
|
+
|
|
199
|
+
- name: List downloaded artifacts
|
|
200
|
+
run: ls -R dist/
|
|
201
|
+
|
|
202
|
+
- name: Generate artifact attestation
|
|
203
|
+
uses: actions/attest-build-provenance@v2
|
|
204
|
+
with:
|
|
205
|
+
subject-path: 'dist/*'
|
|
206
|
+
|
|
207
|
+
- name: Publish to PyPI
|
|
208
|
+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
209
|
+
uses: PyO3/maturin-action@v1
|
|
210
|
+
env:
|
|
211
|
+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
|
212
|
+
with:
|
|
213
|
+
command: upload
|
|
214
|
+
args: --non-interactive --skip-existing dist/*
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
name: WASM
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- master
|
|
8
|
+
pull_request:
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
test:
|
|
16
|
+
name: Test WASM Package
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Setup Rust
|
|
22
|
+
uses: dtolnay/rust-toolchain@stable
|
|
23
|
+
with:
|
|
24
|
+
targets: wasm32-unknown-unknown
|
|
25
|
+
|
|
26
|
+
- name: Setup Node.js
|
|
27
|
+
uses: actions/setup-node@v4
|
|
28
|
+
with:
|
|
29
|
+
node-version: '20'
|
|
30
|
+
|
|
31
|
+
- name: Install wasm-pack
|
|
32
|
+
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
|
33
|
+
|
|
34
|
+
- name: Build and test dual package
|
|
35
|
+
working-directory: wasm
|
|
36
|
+
run: |
|
|
37
|
+
chmod +x test-dual.sh
|
|
38
|
+
./test-dual.sh
|
|
39
|
+
|
|
40
|
+
- name: Upload npm package artifact
|
|
41
|
+
uses: actions/upload-artifact@v4
|
|
42
|
+
with:
|
|
43
|
+
name: npm-package
|
|
44
|
+
path: wasm/pkg-dual
|
|
45
|
+
|
|
46
|
+
build-targets:
|
|
47
|
+
name: Build WASM for Different Targets
|
|
48
|
+
runs-on: ubuntu-latest
|
|
49
|
+
strategy:
|
|
50
|
+
matrix:
|
|
51
|
+
target: [bundler, nodejs, web]
|
|
52
|
+
steps:
|
|
53
|
+
- uses: actions/checkout@v4
|
|
54
|
+
|
|
55
|
+
- name: Setup Rust
|
|
56
|
+
uses: dtolnay/rust-toolchain@stable
|
|
57
|
+
with:
|
|
58
|
+
targets: wasm32-unknown-unknown
|
|
59
|
+
|
|
60
|
+
- name: Install wasm-pack
|
|
61
|
+
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
|
62
|
+
|
|
63
|
+
- name: Build for ${{ matrix.target }}
|
|
64
|
+
working-directory: wasm
|
|
65
|
+
run: wasm-pack build --target ${{ matrix.target }} --release --out-dir pkg-${{ matrix.target }}
|
|
66
|
+
|
|
67
|
+
- name: Upload artifacts
|
|
68
|
+
uses: actions/upload-artifact@v4
|
|
69
|
+
with:
|
|
70
|
+
name: wasm-${{ matrix.target }}
|
|
71
|
+
path: wasm/pkg-${{ matrix.target }}
|
|
72
|
+
|
|
73
|
+
release:
|
|
74
|
+
name: Release to npm
|
|
75
|
+
runs-on: ubuntu-latest
|
|
76
|
+
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
|
|
77
|
+
needs: [test, build-targets]
|
|
78
|
+
permissions:
|
|
79
|
+
contents: write
|
|
80
|
+
id-token: write
|
|
81
|
+
steps:
|
|
82
|
+
- uses: actions/checkout@v4
|
|
83
|
+
|
|
84
|
+
- name: Setup Rust
|
|
85
|
+
uses: dtolnay/rust-toolchain@stable
|
|
86
|
+
with:
|
|
87
|
+
targets: wasm32-unknown-unknown
|
|
88
|
+
|
|
89
|
+
- name: Setup Node.js
|
|
90
|
+
uses: actions/setup-node@v4
|
|
91
|
+
with:
|
|
92
|
+
node-version: '20'
|
|
93
|
+
registry-url: 'https://registry.npmjs.org'
|
|
94
|
+
|
|
95
|
+
- name: Install wasm-pack
|
|
96
|
+
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
|
97
|
+
|
|
98
|
+
- name: Build dual package
|
|
99
|
+
working-directory: wasm
|
|
100
|
+
run: |
|
|
101
|
+
chmod +x build-dual.sh
|
|
102
|
+
./build-dual.sh
|
|
103
|
+
|
|
104
|
+
- name: Publish to npm
|
|
105
|
+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
106
|
+
working-directory: wasm/pkg-dual
|
|
107
|
+
run: npm publish --provenance --access public
|
|
108
|
+
env:
|
|
109
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
110
|
+
|
|
111
|
+
- name: Upload release artifacts
|
|
112
|
+
uses: actions/upload-artifact@v4
|
|
113
|
+
with:
|
|
114
|
+
name: npm-release-package
|
|
115
|
+
path: wasm/pkg-dual
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
**.idea/
|
|
2
|
+
|
|
3
|
+
# Generated by Cargo
|
|
4
|
+
# will have compiled files and executables
|
|
5
|
+
**target/
|
|
6
|
+
|
|
7
|
+
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
|
8
|
+
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
|
9
|
+
**Cargo.lock
|
|
10
|
+
|
|
11
|
+
# These are backup files generated by rustfmt
|
|
12
|
+
**/*.rs.bk
|
|
13
|
+
|
|
14
|
+
# Added by cargo
|
|
15
|
+
/target
|
|
16
|
+
Cargo.lock
|
|
17
|
+
|
|
18
|
+
# WASM build output
|
|
19
|
+
/wasm/pkg/
|
|
20
|
+
/wasm/pkg-nodejs/
|
|
21
|
+
/wasm/pkg-nodejs-temp/
|
|
22
|
+
/wasm/pkg-bundler/
|
|
23
|
+
/wasm/pkg-web/
|
|
24
|
+
/wasm/pkg-dual/
|
|
25
|
+
/wasm/node_modules/
|
|
26
|
+
|
|
27
|
+
# Python build output
|
|
28
|
+
*.so
|
|
29
|
+
*.pyd
|
|
30
|
+
/python/dist/
|
|
31
|
+
/python/build/
|
|
32
|
+
*.egg-info/
|
|
33
|
+
__pycache__/
|
|
34
|
+
.pytest_cache/
|
|
35
|
+
*.pyc
|
|
36
|
+
/python/.venv/
|
|
37
|
+
.venv/
|
|
38
|
+
|
|
39
|
+
# General
|
|
40
|
+
.DS_Store
|
|
41
|
+
*.log
|