Skip to content

Commit 4c61b15

Browse files
committed
pypi packaging workflow
1 parent e823c8f commit 4c61b15

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/package.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
python-version: [3.6, 3.7, 3.8]
14+
os: [ubuntu-latest, macOS-latest, windows-latest]
15+
16+
steps:
17+
- name: Switch branch
18+
uses: actions/checkout@v2
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v1
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
- name: Install Python dependencies
24+
run: |
25+
which python
26+
python -m pip install --upgrade pip
27+
pip install -r requirements.txt
28+
- name: Build crate
29+
run: cargo build --verbose
30+
- name: Test crate
31+
run: cargo test --verbose
32+
- name: Maturin build and publish
33+
run:
34+
maturin publish --no-sdist -u __token__ -i python
35+
env:
36+
MATURIN_PASSWORD: ${{ secrets.PYPI_TOKEN }}
37+
38+
# notes:
39+
# - for test-pypi: maturin publish --no-sdist -u __token__ -i python -r https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)