Skip to content

Commit 7ca98e9

Browse files
committed
env manager
1 parent 18ce366 commit 7ca98e9

File tree

14 files changed

+769
-0
lines changed

14 files changed

+769
-0
lines changed

.github/workflows/publish.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Build and Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
name: Build wheels on ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, windows-latest, macos-latest]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: '3.11'
23+
24+
- name: Set up Rust
25+
uses: actions-rs/toolchain@v1
26+
with:
27+
toolchain: stable
28+
override: true
29+
30+
- name: Install maturin
31+
run: pip install maturin
32+
33+
- name: Build wheels
34+
run: maturin build --release --out dist
35+
36+
- name: Upload wheels
37+
uses: actions/upload-artifact@v3
38+
with:
39+
name: wheels-${{ matrix.os }}
40+
path: dist/
41+
42+
publish:
43+
name: Publish to PyPI
44+
needs: build
45+
runs-on: ubuntu-latest
46+
if: github.event_name == 'release' && github.event.action == 'published'
47+
48+
steps:
49+
- name: Download all wheels
50+
uses: actions/download-artifact@v3
51+
with:
52+
path: dist/
53+
54+
- name: Flatten wheels directory
55+
run: |
56+
mkdir -p wheels
57+
find dist/ -name "*.whl" -exec cp {} wheels/ \;
58+
find dist/ -name "*.tar.gz" -exec cp {} wheels/ \;
59+
ls -la wheels/
60+
61+
- name: Publish to PyPI
62+
uses: PyO3/maturin-action@v1
63+
with:
64+
command: upload
65+
args: --skip-existing wheels/*
66+
env:
67+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,8 @@ cython_debug/
172172

173173
# PyPI configuration file
174174
.pypirc
175+
176+
177+
# Added by cargo
178+
179+
/target

0 commit comments

Comments
 (0)