|
1 | 1 | name: Build |
| 2 | + |
2 | 3 | on: |
3 | 4 | push: |
4 | 5 | branches-ignore: |
|
13 | 14 | workflow_dispatch: |
14 | 15 |
|
15 | 16 | jobs: |
16 | | - |
17 | | - # Build job. Builds source distribution (sdist) and binary wheels distribution (bdist_wheel) |
18 | 17 | build: |
19 | | - name: Build ${{ matrix.dist }} [${{ matrix.python-version }} | ${{ matrix.os }} ${{ matrix.architecture }}] |
| 18 | + name: Build [${{ matrix.python-version }} | ${{ matrix.os }}] |
| 19 | + runs-on: ${{ matrix.os }} |
20 | 20 | strategy: |
21 | 21 | fail-fast: false |
22 | 22 | matrix: |
23 | | - # os: [ubuntu-latest, macos-latest, windows-latest] # Build wheels on different systems |
24 | | - # python-version: [3.6, 3.7] |
25 | | - # architecture: [x64] |
26 | | - # dist: [bdist_wheel] |
27 | | - include: |
28 | | - - os: ubuntu-latest # Modify one element to build source distribution |
29 | | - python-version: '3.10' |
30 | | - architecture: x64 |
31 | | - dist: sdist bdist_wheel |
32 | | - runs-on: ${{ matrix.os }} |
33 | | - env: |
34 | | - PYTHONUNBUFFERED: 1 |
35 | | - |
| 23 | + os: [ubuntu-latest] |
| 24 | + python-version: ['3.13'] |
36 | 25 | steps: |
37 | | - - name: Checkout |
38 | | - uses: actions/checkout@v2 |
| 26 | + - name: Checkout source |
| 27 | + uses: actions/checkout@v4 |
| 28 | + |
| 29 | + - name: Set up Python ${{ matrix.python-version }} |
| 30 | + uses: actions/setup-python@v5 |
| 31 | + with: |
| 32 | + python-version: ${{ matrix.python-version }} |
39 | 33 |
|
40 | | - - name: Set up Python ${{ matrix.python-version }} |
41 | | - uses: actions/setup-python@v2 |
42 | | - with: |
43 | | - python-version: ${{ matrix.python-version }} |
44 | | - architecture: ${{ matrix.architecture }} |
| 34 | + - name: Install build tools |
| 35 | + run: | |
| 36 | + python -m pip install --upgrade pip |
| 37 | + pip install build |
45 | 38 |
|
46 | | - - name: Build |
47 | | - run: | |
48 | | - python -m pip install --upgrade pip |
49 | | - python -m pip install --upgrade setuptools wheel |
50 | | - python setup.py ${{ matrix.dist }} |
| 39 | + - name: Build with `python -m build` |
| 40 | + run: | |
| 41 | + python -m build --wheel --sdist |
51 | 42 |
|
52 | | - - name: Upload artifacts |
53 | | - uses: actions/upload-artifact@v2 |
54 | | - with: |
55 | | - name: dist |
56 | | - path: dist |
| 43 | + - name: Upload merged artifacts per OS |
| 44 | + uses: actions/upload-artifact@v4 |
| 45 | + with: |
| 46 | + name: dist-${{ matrix.os }} |
| 47 | + path: dist/ |
| 48 | + if-no-files-found: error |
57 | 49 |
|
58 | | - # Deploy job. Uploads distribution to PyPI (only on tags) |
59 | 50 | deploy: |
60 | 51 | name: Publish to PyPI |
61 | 52 | runs-on: ubuntu-latest |
62 | 53 | needs: build |
63 | 54 | if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') |
64 | | - env: |
65 | | - PYTHONUNBUFFERED: 1 |
66 | 55 |
|
67 | 56 | steps: |
68 | | - - name: Checkout |
69 | | - uses: actions/checkout@v2 |
| 57 | + - name: Checkout source |
| 58 | + uses: actions/checkout@v4 |
| 59 | + |
| 60 | + - name: Download all artifacts |
| 61 | + uses: actions/download-artifact@v4 |
| 62 | + with: |
| 63 | + path: dist |
70 | 64 |
|
71 | | - - name: Download artifacts |
72 | | - uses: actions/download-artifact@v2 |
73 | | - with: |
74 | | - name: dist |
75 | | - path: dist |
| 65 | + - name: Publish to PyPI |
| 66 | + uses: pypa/gh-action-pypi-publish@v1.8.11 |
| 67 | + with: |
| 68 | + user: __token__ |
| 69 | + password: ${{ secrets.PYPI_TOKEN }} |
| 70 | + packages_dir: dist/ |
76 | 71 |
|
77 | | - - name: Publish to PyPI |
78 | | - uses: pypa/gh-action-pypi-publish@v1.5.0 |
79 | | - with: |
80 | | - user: __token__ |
81 | | - password: ${{ secrets.PYPI_TOKEN }} |
82 | | - packages_dir: dist/ |
0 commit comments