|
1 | 1 | name: Publish to PyPI |
2 | 2 |
|
3 | 3 | on: |
4 | | - release: |
5 | | - types: [published] |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
6 | 7 |
|
7 | 8 | jobs: |
8 | 9 | build: |
9 | 10 | runs-on: ${{ matrix.os }} |
10 | 11 | strategy: |
11 | 12 | matrix: |
12 | | - os: [ubuntu-latest, windows-latest, macos-latest] |
| 13 | + os: [macos-latest] |
13 | 14 |
|
14 | 15 | steps: |
15 | | - - name: Checkout code |
16 | | - uses: actions/checkout@v3 |
| 16 | + - uses: actions/checkout@v4 |
17 | 17 |
|
18 | | - - name: Set up Python |
19 | | - uses: actions/setup-python@v4 |
20 | | - with: |
21 | | - python-version: 3.11 |
| 18 | + - uses: actions/setup-python@v5 |
22 | 19 |
|
23 | 20 | - name: Install build tools |
24 | | - run: pip install build twine wheel cibuildwheel |
| 21 | + run: python -m pip install cibuildwheel |
25 | 22 |
|
26 | 23 | - name: Build wheel with cibuildwheel |
27 | 24 | env: |
28 | | - CIBW_BUILD: cp37-*,cp38-*,cp39-*,cp310-*,cp311-*,cp312-*,cp313-*,cp314-* |
29 | | - run: cibuildwheel --output-dir wheelhouse |
| 25 | + CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*" |
| 26 | + CIBW_BEFORE_BUILD: pip install cffi |
| 27 | + run: python -m cibuildwheel --output-dir wheelhouse |
30 | 28 |
|
31 | 29 | - name: Upload wheels |
32 | | - uses: actions/upload-artifact@v3 |
| 30 | + uses: actions/upload-artifact@v4 |
33 | 31 | with: |
34 | 32 | name: wheels-${{ matrix.os }} |
35 | 33 | path: wheelhouse/ |
36 | 34 |
|
37 | | - publish: |
38 | | - needs: build |
| 35 | + build-dist-artifacts: |
39 | 36 | runs-on: ubuntu-latest |
40 | 37 |
|
41 | 38 | steps: |
42 | | - - name: Download wheels |
43 | | - uses: actions/download-artifact@v3 |
44 | | - with: |
45 | | - name: wheels-ubuntu-latest |
46 | | - - name: Download wheels |
47 | | - uses: actions/download-artifact@v3 |
| 39 | + - uses: actions/checkout@v4 |
| 40 | + |
| 41 | + - uses: actions/setup-python@v5 |
| 42 | + |
| 43 | + - name: Install build tools |
| 44 | + run: pip install build twine wheel cython |
| 45 | + |
| 46 | + - name: Compile and Build package |
| 47 | + run: python setup.py sdist bdist_wheel |
| 48 | + |
| 49 | + - name: Upload dist |
| 50 | + uses: actions/upload-artifact@v4 |
48 | 51 | with: |
49 | | - name: wheels-windows-latest |
| 52 | + name: dist |
| 53 | + path: dist/ |
| 54 | + |
| 55 | + publish: |
| 56 | + needs: |
| 57 | + - build |
| 58 | + - build-dist-artifacts |
| 59 | + runs-on: ubuntu-latest |
| 60 | + |
| 61 | + steps: |
| 62 | + #- name: Download wheels |
| 63 | + # uses: actions/download-artifact@v4 |
| 64 | + # with: |
| 65 | + # name: wheels-ubuntu-latest |
| 66 | + |
| 67 | + #- name: Download wheels |
| 68 | + # uses: actions/download-artifact@v4 |
| 69 | + # with: |
| 70 | + # name: wheels-windows-latest |
| 71 | + |
50 | 72 | - name: Download wheels |
51 | | - uses: actions/download-artifact@v3 |
| 73 | + uses: actions/download-artifact@v4 |
52 | 74 | with: |
53 | 75 | name: wheels-macos-latest |
54 | 76 |
|
55 | | - - name: Combine wheels |
56 | | - run: mkdir dist && mv wheelhouse/* dist/ |
| 77 | + - name: Download dist |
| 78 | + uses: actions/download-artifact@v4 |
| 79 | + with: |
| 80 | + name: dist |
| 81 | + |
| 82 | + - name: Compile and Build package |
| 83 | + run: | |
| 84 | + mkdir -p dist |
| 85 | + for f in *; do |
| 86 | + [ "$f" != "dist" ] && mv "$f" dist/ |
| 87 | + done |
57 | 88 |
|
58 | | - - name: Publish to PyPI |
59 | | - run: ls -la dist |
| 89 | + ls -la |
0 commit comments