Skip to content

Commit ebc2518

Browse files
committed
add a new cibuildwheel support action for pypi update
1 parent 7d61500 commit ebc2518

File tree

2 files changed

+55
-4
lines changed

2 files changed

+55
-4
lines changed

.github/workflows/pypi_release.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
pypi-publish:
99
runs-on: ubuntu-latest
10-
environment: Release Deploy
10+
environment: release deploy
1111

1212
steps:
1313
- uses: actions/checkout@v4
@@ -26,6 +26,4 @@ jobs:
2626
python -m build
2727
2828
- name: Publish package to PyPI
29-
uses: pypa/gh-action-pypi-publish@release/v1
30-
with:
31-
password: ${{ secrets.PYPI_API_TOKEN}}
29+
uses: pypa/gh-action-pypi-publish@release/v1
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: PyPI Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build_wheels:
8+
runs-on: ${{ matrix.os }}
9+
environment: release deploy
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
os: [ubuntu-latest, windows-latest, macos-latest]
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
21+
- name: Upgrade pip and install build + cibuildwheel
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install build cibuildwheel
25+
26+
- name: Build wheels
27+
run: cibuildwheel --output-dir dist
28+
29+
- name: Build sdist (only run on Linux to avoid duplicates)
30+
if: matrix.os == 'ubuntu-latest'
31+
run: python -m build --sdist --outdir dist
32+
33+
- name: Upload build artifacts
34+
uses: actions/upload-artifact@v3
35+
with:
36+
name: dist
37+
path: dist
38+
39+
publish_wheels:
40+
runs-on: ubuntu-latest
41+
needs: build_wheels
42+
43+
steps:
44+
- uses: actions/checkout@v4
45+
46+
- name: Download build artifacts
47+
uses: actions/download-artifact@v3
48+
with:
49+
name: dist
50+
path: dist
51+
52+
- name: Publish package to PyPI
53+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)