Skip to content

Commit 66dd53b

Browse files
committed
sdist on ci
1 parent 6b0b335 commit 66dd53b

File tree

2 files changed

+63
-32
lines changed

2 files changed

+63
-32
lines changed

.github/workflows/python-build.yml

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: Build and Publish
1+
name: Python Build and Publish
22

33
on:
44
push:
55
pull_request:
66

77
jobs:
8-
linux-build:
8+
build-wheels:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
@@ -35,48 +35,53 @@ jobs:
3535
with:
3636
name: wheels_${{ matrix.manylinux }}_${{ matrix.target }}
3737
path: dist
38+
39+
build-sdist:
40+
name: Build Source Distribution (sdist)
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: Checkout Code
44+
uses: actions/checkout@v3
45+
46+
- name: Set up Python
47+
uses: actions/setup-python@v4
48+
with:
49+
python-version: "3.10"
50+
51+
- name: Install Maturin
52+
run: pip install --upgrade maturin
53+
54+
- name: Build sdist
55+
run: maturin sdist --out dist
56+
57+
- name: Upload sdist Artifact
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: sdist
61+
path: dist
3862

3963
pypi-release:
4064
name: Publish to Pypi
4165
runs-on: ubuntu-latest
4266
environment: pypi-publish
43-
if: startsWith(github.ref, 'refs/tags/')
44-
needs: [ linux-build ]
67+
# if: startsWith(github.ref, 'refs/tags/')
68+
needs: [ build-wheels, build-sdist]
4569
steps:
4670
- name: Download Build Artifacts
4771
uses: actions/download-artifact@v4
4872
with:
49-
path: wheels
73+
path: dist
5074

5175
- name: Python Setup
5276
uses: actions/setup-python@v4
5377
with:
5478
python-version: '3.10'
79+
5580

56-
- name: Publish to PyPI
57-
env:
58-
TWINE_USERNAME: __token__
59-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
60-
run: |
61-
pip install --upgrade twine
62-
twine upload --skip-existing wheels/**/*.whl
63-
64-
cratesio-release:
65-
name: Publish to Crates.io
66-
runs-on: ubuntu-latest
67-
environment: cratesio-publish
68-
if: startsWith(github.ref, 'refs/tags/')
69-
steps:
70-
- name: Checkout Code
71-
uses: actions/checkout@v3
72-
73-
- name: Set up Rust
74-
uses: actions-rs/toolchain@v1
75-
with:
76-
toolchain: stable
77-
override: true
78-
79-
- name: Publish to crates.io
80-
env:
81-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
82-
run: cargo publish
81+
# - name: Publish to PyPI
82+
# env:
83+
# TWINE_USERNAME: __token__
84+
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
85+
# run: |
86+
# pip install --upgrade twine
87+
# twine upload --skip-existing dist/**/*.whl dist/**/*.tar.gz

.github/workflows/rust-build.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Rust Build and Publish
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
cratesio-release:
9+
name: Publish to Crates.io
10+
runs-on: ubuntu-latest
11+
environment: cratesio-publish
12+
if: startsWith(github.ref, 'refs/tags/')
13+
steps:
14+
- name: Checkout Code
15+
uses: actions/checkout@v3
16+
17+
- name: Set up Rust
18+
uses: actions-rs/toolchain@v1
19+
with:
20+
toolchain: stable
21+
override: true
22+
23+
- name: Publish to crates.io
24+
env:
25+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
26+
run: cargo publish

0 commit comments

Comments
 (0)