-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (43 loc) · 1.24 KB
/
python-ci.yml
File metadata and controls
46 lines (43 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Python CI
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
jobs:
build:
name: Build wheels (linux x86_64)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build manylinux wheel
uses: PyO3/maturin-action@v1
with:
command: build
args: --features python --release --out dist
manylinux: auto
- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: wheels-linux
path: dist/
publish-pypi:
name: Publish to PyPI
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
id-token: write # required for PyPI Trusted Publishing (OIDC)
steps:
- uses: actions/download-artifact@v4
with:
name: wheels-linux
path: dist/
- name: Publish
# Trusted Publishing: no token needed once project is registered on PyPI
# with this repo as a trusted publisher (https://pypi.org/manage/account/publishing/)
# Fallback: set PYPI_API_TOKEN secret and use password auth below
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true