|
7 | 7 | workflow_dispatch: |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - build-linux: |
11 | | - name: Build wheels on manylinux |
| 10 | + release: |
12 | 11 | runs-on: ubuntu-latest |
| 12 | + permissions: |
| 13 | + id-token: write |
| 14 | + contents: write |
13 | 15 |
|
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v3 |
| 18 | + with: |
| 19 | + fetch-depth: 0 |
| 20 | + |
| 21 | + - name: Python Semantic Release |
| 22 | + uses: python-semantic-release/python-semantic-release@master |
| 23 | + with: |
| 24 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 25 | + |
| 26 | + wheels: |
| 27 | + needs: |
| 28 | + - release |
| 29 | + runs-on: ${{ matrix.os }} |
| 30 | + env: |
| 31 | + version: steps.release.outputs.version |
14 | 32 | strategy: |
| 33 | + fail-fast: false |
15 | 34 | matrix: |
16 | | - python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] |
| 35 | + include: |
| 36 | + - os: ubuntu-20.04 |
| 37 | + - os: macos-11 |
| 38 | + - os: windows-2019 |
| 39 | + architecture: x86 |
| 40 | + - os: windows-2019 |
| 41 | + architecture: AMD64 |
17 | 42 |
|
18 | 43 | steps: |
19 | | - - name: Checkout code |
20 | | - uses: actions/checkout@v4 |
21 | | - |
22 | | - - name: Set up Python ${{ matrix.python-version }} |
23 | | - uses: actions/setup-python@v5 |
| 44 | + - uses: actions/checkout@v3 |
| 45 | + - uses: docker/setup-qemu-action@v2 |
24 | 46 | with: |
25 | | - python-version: ${{ matrix.python-version }} |
26 | | - |
27 | | - - name: Install build dependencies |
28 | | - run: | |
29 | | - python -m pip install --upgrade pip setuptools wheel build |
30 | | -
|
31 | | - - name: Build sdist (source distribution) |
32 | | - run: | |
33 | | - python -m build --sdist |
34 | | -
|
35 | | - - name: Build wheel inside manylinux container |
36 | | - run: | |
37 | | - docker run --rm \ |
38 | | - -v ${{ github.workspace }}:/io \ |
39 | | - quay.io/pypa/manylinux_2_28_x86_64 \ |
40 | | - bash -c "cd /io && /opt/python/cp${{ matrix.python-version//./}}-cp${{ matrix.python-version//./}}/bin/python -m build --wheel" |
41 | | -
|
42 | | - - name: List build artifacts |
43 | | - run: ls -lh dist/ |
44 | | - |
45 | | - - name: Upload wheels as artifacts |
46 | | - uses: actions/upload-artifact@v4 |
| 47 | + platforms: arm64 |
| 48 | + if: runner.os == 'Linux' |
| 49 | + - uses: bus1/cabuild/action/msdevshell@v1 |
47 | 50 | with: |
48 | | - name: wheels-${{ matrix.python-version }} |
49 | | - path: dist/ |
50 | | - |
51 | | - # build-windows: |
52 | | - # name: Build Windows packages |
53 | | - # runs-on: windows-2019 |
54 | | - # strategy: |
55 | | - # fail-fast: false |
56 | | - # matrix: |
57 | | - # python-version: ["3.11", "3.12", "3.13"] |
58 | | - # architecture: [x64, x86] |
59 | | - # steps: |
60 | | - # - uses: actions/checkout@v4 |
61 | | - |
62 | | - # - name: Set up Python ${{ matrix.python-version }} |
63 | | - # uses: actions/setup-python@v5 |
64 | | - # with: |
65 | | - # python-version: ${{ matrix.python-version }} |
66 | | - # architecture: ${{ matrix.architecture }} |
67 | | - |
68 | | - # - name: Set up MSVC |
69 | | - # uses: bus1/cabuild/action/msdevshell@v1 |
70 | | - # with: |
71 | | - # architecture: ${{ matrix.architecture }} |
72 | | - |
73 | | - # - name: Generate meson files |
74 | | - # run: | |
75 | | - # python scripts/generate_meson.py ./src/dbzero/ core |
76 | | - # python scripts/generate_meson_tests.py tests/ |
77 | | - |
78 | | - # - name: Configure git |
79 | | - # run: | |
80 | | - # git config --global user.email "ci@example.com" |
81 | | - # git config --global user.name "CI Builder" |
82 | | - # Remove-Item .gitignore -ErrorAction SilentlyContinue |
83 | | - # git add . && git commit -m "Update meson files for build" |
84 | | - |
85 | | - # - name: Install build dependencies |
86 | | - # run: | |
87 | | - # pip install build cibuildwheel |
88 | | - |
89 | | - # - name: Build wheels (Windows) |
90 | | - # run: python -m cibuildwheel --output-dir wheelhouse |
91 | | - # env: |
92 | | - # CIBW_BUILD: cp${{ matrix.python-version }}-* |
93 | | - # CIBW_ARCHS_WINDOWS: ${{ matrix.architecture }} |
94 | | - |
95 | | - # - name: Upload Windows wheels |
96 | | - # uses: actions/upload-artifact@v4 |
97 | | - # with: |
98 | | - # name: wheels-windows-${{ matrix.python-version }}-${{ matrix.architecture }} |
99 | | - # path: wheelhouse/*.whl |
| 51 | + architecture: x64 |
| 52 | + if: runner.os == 'Windows' && matrix.architecture == 'AMD64' |
| 53 | + - uses: bus1/cabuild/action/msdevshell@v1 |
| 54 | + with: |
| 55 | + architecture: x86 |
| 56 | + if: runner.os == 'Windows' && matrix.architecture == 'x86' |
| 57 | + - run: pip3 install pipx |
| 58 | + - run: pipx run cibuildwheel==2.11.2 |
| 59 | + env: |
| 60 | + CIBW_SKIP: pp* cp36-* *-musllinux* |
| 61 | + CIBW_ARCHS_MACOS: x86_64 arm64 |
| 62 | + CIBW_ARCHS_LINUX: x86_64 aarch64 |
| 63 | + CIBW_ARCHS_WINDOWS: ${{ matrix.architecture }} |
| 64 | + - uses: actions/upload-artifact@v3 |
| 65 | + with: |
| 66 | + path: wheelhouse/*.whl |
100 | 67 |
|
101 | | - build-sdist: |
102 | | - name: Build source distribution |
| 68 | + sdist: |
| 69 | + needs: |
| 70 | + - release |
103 | 71 | runs-on: ubuntu-latest |
104 | 72 | steps: |
105 | | - - uses: actions/checkout@v4 |
106 | | - |
107 | | - - name: Set up Python |
108 | | - uses: actions/setup-python@v5 |
109 | | - with: |
110 | | - python-version: "3.11" |
111 | | - |
112 | | - - name: Generate meson files |
113 | | - run: | |
114 | | - python3 scripts/generate_meson.py ./src/dbzero/ core |
115 | | - python3 scripts/generate_meson_tests.py tests/ |
116 | | - |
117 | | - - name: Configure git |
118 | | - run: | |
119 | | - git config --global user.email "ci@example.com" |
120 | | - git config --global user.name "CI Builder" |
121 | | - rm .gitignore |
122 | | - git add . && git commit -m "Update meson files for build" |
123 | | - |
124 | | - - name: Install build dependencies |
125 | | - run: | |
126 | | - pip install build meson |
127 | | - |
128 | | - - name: Build source distribution |
129 | | - run: python -m build --sdist |
130 | | - |
131 | | - - name: Upload sdist |
132 | | - uses: actions/upload-artifact@v4 |
| 73 | + - uses: actions/checkout@v3 |
| 74 | + - run: python -m pip install build meson |
| 75 | + - run: python -m build --sdist |
| 76 | + - uses: actions/upload-artifact@v3 |
133 | 77 | with: |
134 | | - name: sdist |
135 | 78 | path: dist/*.tar.gz |
136 | 79 |
|
137 | 80 | deploy-to-pypi: |
|
0 commit comments