|
12 | 12 | jobs: |
13 | 13 | tar_gz: |
14 | 14 | name: Package |
15 | | - runs-on: ubuntu-latest |
| 15 | + runs-on: ubuntu-22.04 |
16 | 16 | steps: |
17 | | - - uses: actions/checkout@v3 |
18 | | - - uses: actions/setup-python@v3 |
| 17 | + - uses: actions/checkout@master |
| 18 | + - uses: actions/setup-python@master |
| 19 | + with: |
| 20 | + python-version: 3.12 |
| 21 | + - run: pip install -r requirements-build-3_12.txt |
19 | 22 | - run: python setup.py sdist |
20 | 23 | - uses: actions/upload-artifact@v3 |
21 | 24 | with: |
22 | 25 | name: dist |
23 | 26 | path: dist |
24 | 27 |
|
25 | | - whl_lt_3_9: |
| 28 | + matrix_config: |
| 29 | + name: Matrix Runner Config |
| 30 | + runs-on: ubuntu-22.04 |
| 31 | + outputs: |
| 32 | + matrix_os: ${{ steps.step.outputs.matrix_os }} |
| 33 | + steps: |
| 34 | + - run: echo "$GITHUB_EVENT_NAME" |
| 35 | + - id: step |
| 36 | + run: | |
| 37 | + if [ "$GITHUB_EVENT_NAME" = "release" ]; then |
| 38 | + echo 'matrix_os=["macos-13-xlarge", "ubuntu-22.04", "windows-2022"]' >> $GITHUB_OUTPUT |
| 39 | + else |
| 40 | + echo 'matrix_os=["macos-13", "ubuntu-22.04", "windows-2022"]' >> $GITHUB_OUTPUT |
| 41 | + fi |
| 42 | +
|
| 43 | + whl_3_8: |
26 | 44 | name: Build / ${{ matrix.os }} / Python 3.${{ matrix.minor }} |
| 45 | + needs: matrix_config |
27 | 46 | strategy: |
28 | 47 | fail-fast: false |
29 | 48 | matrix: |
30 | | - os: [macos-12, ubuntu-22.04, windows-2022] |
31 | | - minor: [7, 8] |
| 49 | + os: ${{ fromJson(needs.matrix_config.outputs.matrix_os) }} |
| 50 | + minor: [8] |
32 | 51 | runs-on: ${{ matrix.os }} |
33 | 52 | steps: |
34 | | - - uses: actions/checkout@v3 |
35 | | - - uses: actions/setup-python@v3 |
36 | | - - uses: pypa/cibuildwheel@v2.13.0 |
| 53 | + - uses: actions/checkout@master |
| 54 | + - uses: actions/setup-python@master |
| 55 | + - run: echo '::add-matcher::.github/problem-matchers/gcc.json' |
| 56 | + if: startsWith(matrix.os, 'macos-') || startsWith(matrix.os, 'ubuntu-') |
| 57 | + - run: echo '::add-matcher::.github/problem-matchers/msvc.json' |
| 58 | + if: startsWith(matrix.os, 'windows-') |
| 59 | + |
| 60 | + - run: pip install pipx # only for macos amd64 |
| 61 | + if: startsWith(matrix.os, 'macos-') |
| 62 | + |
| 63 | + - uses: pypa/cibuildwheel@v2.16.2 |
37 | 64 | with: |
38 | 65 | output-dir: dist |
39 | 66 | env: |
40 | 67 | CIBW_BUILD: cp3${{ matrix.minor }}-* |
41 | | - CIBW_ARCHS_MACOS: all |
42 | | - CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build-backward.txt |
43 | | - CIBW_BEFORE_TEST: pip install -r {project}/requirements-test-backward.txt |
| 68 | + CIBW_ARCHS_WINDOWS: x86 AMD64 |
| 69 | + CIBW_ARCHS_MACOS: x86_64 arm64 |
| 70 | + CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build-3_08.txt |
| 71 | + CIBW_BEFORE_TEST: pip install -r {project}/requirements-dev-3_08.txt |
44 | 72 | CIBW_TEST_COMMAND: pytest {project} |
45 | | - |
46 | 73 | - uses: actions/upload-artifact@v3 |
47 | 74 | with: |
48 | 75 | name: dist |
49 | 76 | path: dist |
50 | 77 |
|
51 | | - whl_gte_3_9: |
| 78 | + whl_gte_3_9_to_3_11: |
52 | 79 | name: Build / ${{ matrix.os }} / Python 3.${{ matrix.minor }} |
| 80 | + needs: matrix_config |
53 | 81 | strategy: |
54 | 82 | fail-fast: false |
55 | 83 | matrix: |
56 | | - os: [macos-12, ubuntu-22.04, windows-2022] |
| 84 | + os: ${{fromJson(needs.matrix_config.outputs.matrix_os)}} |
57 | 85 | minor: [9, 10, 11] |
58 | 86 | runs-on: ${{ matrix.os }} |
59 | 87 | steps: |
60 | | - - uses: actions/checkout@v3 |
61 | | - - uses: actions/setup-python@v3 |
62 | | - - uses: pypa/cibuildwheel@v2.13.0 |
| 88 | + - uses: actions/checkout@master |
| 89 | + - uses: actions/setup-python@master |
| 90 | + - run: echo '::add-matcher::.github/problem-matchers/gcc.json' |
| 91 | + if: startsWith(matrix.os, 'macos-') || startsWith(matrix.os, 'ubuntu-') |
| 92 | + - run: echo '::add-matcher::.github/problem-matchers/msvc.json' |
| 93 | + if: startsWith(matrix.os, 'windows-') |
| 94 | + |
| 95 | + - run: pip install pipx |
| 96 | + if: startsWith(matrix.os, 'macos-') |
| 97 | + |
| 98 | + - uses: pypa/cibuildwheel@v2.16.2 |
63 | 99 | with: |
64 | 100 | output-dir: dist |
65 | 101 | env: |
66 | 102 | CIBW_BUILD: cp3${{ matrix.minor }}-* |
67 | | - CIBW_ARCHS_MACOS: all |
68 | | - CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build.txt |
69 | | - CIBW_BEFORE_TEST: pip install -r {project}/requirements-test.txt |
| 103 | + CIBW_ARCHS_WINDOWS: x86 AMD64 |
| 104 | + CIBW_ARCHS_MACOS: x86_64 arm64 |
| 105 | + CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build-3_11.txt |
| 106 | + CIBW_BEFORE_TEST: pip install -r {project}/requirements-dev-3_11.txt |
70 | 107 | CIBW_TEST_COMMAND: pytest {project} |
71 | | - |
72 | 108 | - uses: actions/upload-artifact@v3 |
73 | 109 | with: |
74 | 110 | name: dist |
75 | 111 | path: dist |
76 | 112 |
|
77 | | - forward: |
78 | | - name: Forward / ${{ matrix.os }} / Python 3.${{ matrix.minor }} |
| 113 | + whl_3_12: |
| 114 | + name: Build / ${{ matrix.os }} / Python 3.${{ matrix.minor }} |
| 115 | + needs: matrix_config |
79 | 116 | strategy: |
80 | 117 | fail-fast: false |
81 | 118 | matrix: |
82 | | - os: [ubuntu-22.04] |
83 | | - minor: [11] |
| 119 | + os: ${{fromJson(needs.matrix_config.outputs.matrix_os)}} |
| 120 | + minor: [12] |
84 | 121 | runs-on: ${{ matrix.os }} |
85 | 122 | steps: |
86 | | - - uses: actions/checkout@v3 |
87 | | - - uses: actions/setup-python@v3 |
88 | | - - uses: pypa/cibuildwheel@v2.13.0 |
| 123 | + - uses: actions/checkout@master |
| 124 | + - uses: actions/setup-python@master |
| 125 | + - run: echo '::add-matcher::.github/problem-matchers/gcc.json' |
| 126 | + if: startsWith(matrix.os, 'macos-') || startsWith(matrix.os, 'ubuntu-') |
| 127 | + - run: echo '::add-matcher::.github/problem-matchers/msvc.json' |
| 128 | + if: startsWith(matrix.os, 'windows-') |
| 129 | + |
| 130 | + - run: pip install pipx # only for macos amd64 |
| 131 | + if: startsWith(matrix.os, 'macos-') |
| 132 | + |
| 133 | + - uses: pypa/cibuildwheel@v2.16.2 |
89 | 134 | with: |
90 | 135 | output-dir: dist |
91 | 136 | env: |
92 | 137 | CIBW_BUILD: cp3${{ matrix.minor }}-* |
93 | | - CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build.txt |
94 | | - CIBW_BEFORE_TEST: pip install -r {project}/requirements-test-forward.txt |
| 138 | + CIBW_ARCHS_WINDOWS: x86 AMD64 |
| 139 | + CIBW_ARCHS_MACOS: x86_64 arm64 |
| 140 | + CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build-3_12.txt |
| 141 | + CIBW_BEFORE_TEST: pip install -r {project}/requirements-dev-3_12.txt |
95 | 142 | CIBW_TEST_COMMAND: pytest {project} |
| 143 | + - uses: actions/upload-artifact@v3 |
| 144 | + with: |
| 145 | + name: dist |
| 146 | + path: dist |
96 | 147 |
|
97 | 148 | upload: |
98 | 149 | name: Publish |
99 | | - if: github.event_name == 'release' && github.event.action == 'published' |
100 | | - needs: [tar_gz, whl_lt_3_9, whl_gte_3_9, forward] |
| 150 | + if: github.event_name == 'release' |
| 151 | + needs: [tar_gz, whl_3_8, whl_gte_3_9_to_3_11, whl_3_12] |
101 | 152 | runs-on: ubuntu-latest |
102 | 153 | steps: |
103 | 154 | - uses: actions/download-artifact@v3 |
|
0 commit comments