Skip to content

Commit 79ed702

Browse files
authored
Add Maturin PyPI release CI (#71)
1 parent e65788f commit 79ed702

File tree

2 files changed

+38
-8
lines changed

2 files changed

+38
-8
lines changed

.github/workflows/maturin_ci.yml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
# This file is autogenerated by maturin v1.7.1
1+
# This file is autogenerated by maturin v1.7.4
22
# To update, run
33
#
4-
# maturin generate-ci github --pytest --platform all
4+
# maturin generate-ci github --pytest --platform linux
55
#
66
name: Maturin CI
7+
78
on:
89
push:
910
paths:
@@ -27,6 +28,8 @@ jobs:
2728
target: x86_64
2829
- runner: ubuntu-latest
2930
target: x86
31+
- runner: ubuntu-latest
32+
target: aarch64
3033
steps:
3134
- uses: actions/checkout@v4
3235
- uses: actions/setup-python@v5
@@ -52,7 +55,7 @@ jobs:
5255
python3 -m venv .venv
5356
source .venv/bin/activate
5457
pip install sedpack --find-links dist --force-reinstall
55-
pip3 install --require-hashes --no-deps -r requirements.txt # TODO workaround
58+
pip install --require-hashes --no-deps -r requirements.txt # TODO workaround
5659
pip install pytest
5760
pytest
5861
- name: pytest
@@ -68,8 +71,8 @@ jobs:
6871
pip3 install -U pip pytest
6972
run: |
7073
set -e
71-
pip3 install sedpack --find-links dist --force-reinstall
7274
pip3 install --require-hashes --no-deps -r requirements.txt # TODO workaround
75+
pip3 install sedpack --find-links dist --force-reinstall
7376
pytest
7477
7578
sdist:
@@ -86,3 +89,30 @@ jobs:
8689
with:
8790
name: wheels-sdist
8891
path: dist
92+
93+
release:
94+
name: Release
95+
runs-on: ubuntu-latest
96+
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
97+
needs: [linux, sdist]
98+
permissions:
99+
# Use to sign the release artifacts
100+
id-token: write
101+
# Used to upload release artifacts
102+
contents: write
103+
# Used to generate artifact attestation
104+
attestations: write
105+
steps:
106+
- uses: actions/download-artifact@v4
107+
- name: Generate artifact attestation
108+
uses: actions/attest-build-provenance@v1
109+
with:
110+
subject-path: 'wheels-*/*'
111+
- name: Publish to PyPI
112+
if: "startsWith(github.ref, 'refs/tags/')"
113+
uses: PyO3/maturin-action@v1
114+
env:
115+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
116+
with:
117+
command: upload
118+
args: --non-interactive --skip-existing wheels-*/*

rust/Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)