-
Notifications
You must be signed in to change notification settings - Fork 2
63 lines (55 loc) · 1.78 KB
/
publish_to_pypi_ci.yml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Publish Python distribution to PyPI
on:
push:
branches:
- "main"
jobs:
build:
name: Build distribution
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- python-version: "3.8"
python-version-sub: "38"
- python-version: "3.9"
python-version-sub: "39"
- python-version: "3.10"
python-version-sub: "310"
- python-version: "3.11"
python-version-sub: "311"
- python-version: "3.12"
python-version-sub: "312"
steps:
- uses: actions/checkout@v4
# Build by cibuildwheel
- name: Build wheels
uses: pypa/[email protected]
env:
python-version: ${{ matrix.python-version }}
# Modify as needed, you may need to adjust this line according to your requirements
CIBW_BUILD: "cp${{ matrix.python-version-sub }}-manylinux_x86_64"
CIBW_BEFORE_BUILD: "cmake . -DPYTHON_EXECUTABLE=/usr/local/bin/python${{ matrix.python-version }} -DCMAKE_BUILD_TYPE=Release && cmake --build . -j"
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: ./wheelhouse/*.whl
publish-to-pypi:
name: Publish Python distribution to PyPI
needs:
- build
runs-on: ubuntu-22.04
environment:
name: pypi
url: https://pypi.org/p/qdd
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1