Skip to content

Commit 0dc2395

Browse files
authored
update cargo configuration and CI file (#298)
* update cargo configuration and CI file * use maturin CI for publishing * v0.2.6
1 parent 25c6f58 commit 0dc2395

File tree

4 files changed

+98
-71
lines changed

4 files changed

+98
-71
lines changed

.github/workflows/ci.yml

Lines changed: 95 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This file is autogenerated by maturin v1.8.1
1+
# This file is autogenerated by maturin v1.7.5
22
# To update, run
33
#
44
# maturin generate-ci github
@@ -19,6 +19,72 @@ permissions:
1919
contents: read
2020

2121
jobs:
22+
linux:
23+
runs-on: ${{ matrix.platform.runner }}
24+
strategy:
25+
matrix:
26+
platform:
27+
- runner: ubuntu-22.04
28+
target: x86_64
29+
- runner: ubuntu-22.04
30+
target: x86
31+
- runner: ubuntu-22.04
32+
target: aarch64
33+
- runner: ubuntu-22.04
34+
target: armv7
35+
- runner: ubuntu-22.04
36+
target: s390x
37+
- runner: ubuntu-22.04
38+
target: ppc64le
39+
steps:
40+
- uses: actions/checkout@v4
41+
- uses: actions/setup-python@v5
42+
with:
43+
python-version: 3.x
44+
- name: Build wheels
45+
uses: PyO3/maturin-action@v1
46+
with:
47+
target: ${{ matrix.platform.target }}
48+
args: --release --out dist
49+
sccache: 'true'
50+
manylinux: auto
51+
- name: Upload wheels
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: wheels-linux-${{ matrix.platform.target }}
55+
path: dist
56+
57+
musllinux:
58+
runs-on: ${{ matrix.platform.runner }}
59+
strategy:
60+
matrix:
61+
platform:
62+
- runner: ubuntu-22.04
63+
target: x86_64
64+
- runner: ubuntu-22.04
65+
target: x86
66+
- runner: ubuntu-22.04
67+
target: aarch64
68+
- runner: ubuntu-22.04
69+
target: armv7
70+
steps:
71+
- uses: actions/checkout@v4
72+
- uses: actions/setup-python@v5
73+
with:
74+
python-version: 3.x
75+
- name: Build wheels
76+
uses: PyO3/maturin-action@v1
77+
with:
78+
target: ${{ matrix.platform.target }}
79+
args: --release --out dist
80+
sccache: 'true'
81+
manylinux: musllinux_1_2
82+
- name: Upload wheels
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: wheels-musllinux-${{ matrix.platform.target }}
86+
path: dist
87+
2288
windows:
2389
runs-on: ${{ matrix.platform.runner }}
2490
strategy:
@@ -38,7 +104,7 @@ jobs:
38104
uses: PyO3/maturin-action@v1
39105
with:
40106
target: ${{ matrix.platform.target }}
41-
args: --release --out dist --find-interpreter
107+
args: --release --out dist
42108
sccache: 'true'
43109
- name: Upload wheels
44110
uses: actions/upload-artifact@v4
@@ -64,7 +130,7 @@ jobs:
64130
uses: PyO3/maturin-action@v1
65131
with:
66132
target: ${{ matrix.platform.target }}
67-
args: --release --out dist --find-interpreter
133+
args: --release --out dist
68134
sccache: 'true'
69135
- name: Upload wheels
70136
uses: actions/upload-artifact@v4
@@ -85,4 +151,29 @@ jobs:
85151
uses: actions/upload-artifact@v4
86152
with:
87153
name: wheels-sdist
88-
path: dist
154+
path: dist
155+
156+
release:
157+
name: Release
158+
runs-on: ubuntu-latest
159+
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
160+
needs: [linux, musllinux, windows, macos, sdist]
161+
permissions:
162+
# Use to sign the release artifacts
163+
id-token: write
164+
# Used to upload release artifacts
165+
contents: write
166+
# Used to generate artifact attestation
167+
attestations: write
168+
steps:
169+
- uses: actions/download-artifact@v4
170+
- name: Generate artifact attestation
171+
uses: actions/attest-build-provenance@v1
172+
with:
173+
subject-path: 'wheels-*/*'
174+
- name: Publish to PyPI
175+
if: "startsWith(github.ref, 'refs/tags/')"
176+
uses: PyO3/maturin-action@v1
177+
with:
178+
command: upload
179+
args: --non-interactive --skip-existing wheels-*/*

.github/workflows/pypi.yml

Lines changed: 0 additions & 64 deletions
This file was deleted.

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rshgf"
3-
version = "0.2.5"
3+
version = "0.2.6"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -10,5 +10,5 @@ crate-type = ["cdylib", "rlib"]
1010
path = "src/lib.rs" # The source file of the target.
1111

1212
[dependencies]
13-
pyo3 = { version = "0.24.2", features = ["extension-module"] }
13+
pyo3 = { version = "0.24.2", features = ["extension-module", "abi3-py37"] }
1414
numpy = "0.24"

0 commit comments

Comments
 (0)