Skip to content

Commit d9a504b

Browse files
committed
edit: workflow filw
1 parent ee2ab58 commit d9a504b

2 files changed

Lines changed: 198 additions & 15 deletions

File tree

.github/workflows/release.yaml

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

.github/workflows/release.yml

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
name: Release rem_math lib workflow
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "[0-200]+.[0-200]+.[0-200]+"
9+
- "[0-200]+.[0-200]+.[0-200]+a[0-9]+"
10+
- "[0-200]+.[0-200]+.[0-200]+b[0-9]+"
11+
- "[0-200]+.[0-200]+.[0-200]+rc[0-9]+"
12+
13+
pull_request:
14+
workflow_dispatch:
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
test:
21+
runs-on: ${{ matrix.platform.runner }}
22+
strategy:
23+
matrix:
24+
platform:
25+
- runner: ubuntu-22.04
26+
target: x86_64
27+
- runner: ubuntu-22.04
28+
target: x86
29+
- runner: ubuntu-22.04
30+
target: aarch64
31+
- runner: ubuntu-22.04
32+
target: armv7
33+
- runner: ubuntu-22.04
34+
target: s390x
35+
- runner: ubuntu-22.04
36+
steps:
37+
- uses: actions/checkout@v4
38+
- name: Testing Rust modules
39+
run: |
40+
cargo test --verbose
41+
42+
linux:
43+
runs-on: ${{ matrix.platform.runner }}
44+
strategy:
45+
matrix:
46+
platform:
47+
- runner: ubuntu-22.04
48+
target: x86_64
49+
- runner: ubuntu-22.04
50+
target: x86
51+
- runner: ubuntu-22.04
52+
target: aarch64
53+
- runner: ubuntu-22.04
54+
target: armv7
55+
- runner: ubuntu-22.04
56+
target: s390x
57+
- runner: ubuntu-22.04
58+
target: ppc64le
59+
steps:
60+
- uses: actions/checkout@v4
61+
- uses: actions/setup-python@v5
62+
with:
63+
python-version: 3.x
64+
- name: Build wheels
65+
uses: PyO3/maturin-action@v1
66+
with:
67+
target: ${{ matrix.platform.target }}
68+
args: --release --out dist --find-interpreter
69+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
70+
manylinux: auto
71+
- name: Upload wheels
72+
uses: actions/upload-artifact@v4
73+
with:
74+
name: wheels-linux-${{ matrix.platform.target }}
75+
path: dist
76+
77+
musllinux:
78+
runs-on: ${{ matrix.platform.runner }}
79+
strategy:
80+
matrix:
81+
platform:
82+
- runner: ubuntu-22.04
83+
target: x86_64
84+
- runner: ubuntu-22.04
85+
target: x86
86+
- runner: ubuntu-22.04
87+
target: aarch64
88+
- runner: ubuntu-22.04
89+
target: armv7
90+
steps:
91+
- uses: actions/checkout@v4
92+
- uses: actions/setup-python@v5
93+
with:
94+
python-version: 3.x
95+
- name: Build wheels
96+
uses: PyO3/maturin-action@v1
97+
with:
98+
target: ${{ matrix.platform.target }}
99+
args: --release --out dist --find-interpreter
100+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
101+
manylinux: musllinux_1_2
102+
- name: Upload wheels
103+
uses: actions/upload-artifact@v4
104+
with:
105+
name: wheels-musllinux-${{ matrix.platform.target }}
106+
path: dist
107+
108+
windows:
109+
runs-on: ${{ matrix.platform.runner }}
110+
strategy:
111+
matrix:
112+
platform:
113+
- runner: windows-latest
114+
target: x64
115+
- runner: windows-latest
116+
target: x86
117+
steps:
118+
- uses: actions/checkout@v4
119+
- uses: actions/setup-python@v5
120+
with:
121+
python-version: 3.x
122+
architecture: ${{ matrix.platform.target }}
123+
- name: Build wheels
124+
uses: PyO3/maturin-action@v1
125+
with:
126+
target: ${{ matrix.platform.target }}
127+
args: --release --out dist --find-interpreter
128+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
129+
- name: Upload wheels
130+
uses: actions/upload-artifact@v4
131+
with:
132+
name: wheels-windows-${{ matrix.platform.target }}
133+
path: dist
134+
135+
macos:
136+
runs-on: ${{ matrix.platform.runner }}
137+
strategy:
138+
matrix:
139+
platform:
140+
- runner: macos-13
141+
target: x86_64
142+
- runner: macos-14
143+
target: aarch64
144+
steps:
145+
- uses: actions/checkout@v4
146+
- uses: actions/setup-python@v5
147+
with:
148+
python-version: 3.x
149+
- name: Build wheels
150+
uses: PyO3/maturin-action@v1
151+
with:
152+
target: ${{ matrix.platform.target }}
153+
args: --release --out dist --find-interpreter
154+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
155+
- name: Upload wheels
156+
uses: actions/upload-artifact@v4
157+
with:
158+
name: wheels-macos-${{ matrix.platform.target }}
159+
path: 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+
- name: Upload sdist
171+
uses: actions/upload-artifact@v4
172+
with:
173+
name: wheels-sdist
174+
path: dist
175+
176+
release:
177+
name: Release
178+
runs-on: ubuntu-latest
179+
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
180+
needs: [linux, musllinux, windows, macos, sdist]
181+
permissions:
182+
id-token: write
183+
contents: write
184+
attestations: write
185+
steps:
186+
- uses: actions/download-artifact@v4
187+
- name: Generate artifact attestation
188+
uses: actions/attest-build-provenance@v2
189+
with:
190+
subject-path: 'wheels-*/*'
191+
- name: Publish to PyPI
192+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
193+
uses: PyO3/maturin-action@v1
194+
env:
195+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
196+
with:
197+
command: upload
198+
args: --non-interactive --skip-existing wheels-*/*

0 commit comments

Comments
 (0)