Skip to content

Commit 47f801d

Browse files
committed
python: Build python wrapper wheels with github actions
1 parent f301a22 commit 47f801d

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/pypi.yaml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: pypi
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
permissions:
10+
id-token: write
11+
12+
jobs:
13+
build-linux:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.10'
20+
cache: 'pip'
21+
- run: |
22+
pip install auditwheel patchelf
23+
pip wheel . -w wheel
24+
auditwheel repair -w dist --plat=manylinux_2_17_x86_64 wheel/*.whl
25+
- uses: actions/upload-artifact@v4
26+
with:
27+
name: python-package-linux
28+
path: dist/*.whl
29+
30+
build-macos:
31+
runs-on: macos-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: actions/setup-python@v5
35+
with:
36+
python-version: '3.10'
37+
cache: 'pip'
38+
- run: |
39+
pip wheel . -w dist
40+
- uses: actions/upload-artifact@v4
41+
with:
42+
name: python-package-macos
43+
path: dist/*.whl
44+
45+
publish:
46+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
47+
runs-on: ubuntu-latest
48+
needs: [build-linux, build-macos]
49+
environment:
50+
name: pypi
51+
url: https://pypi.org/p/pylc3
52+
steps:
53+
- uses: actions/download-artifact@v4
54+
with:
55+
merge-multiple: true
56+
path: dist/
57+
- uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)