File: build_wheels.yml

package info (click to toggle)
libm2k 0.9.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 95,580 kB
  • sloc: xml: 1,611,497; cpp: 16,278; python: 4,181; cs: 516; sh: 471; ansic: 403; makefile: 35
file content (72 lines) | stat: -rw-r--r-- 2,643 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Build

on: [push, pull_request]

# TODO: add a simple test that tries to import the libm2k package after creating wheel; 
# NOTE: do i have a acces to a pip install during the cybuildwheel process?
jobs:
  build_wheels:
    name: Build wheels on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04]
        # os: [CentOS_7] # manylinux2014: (CentOS 7 based)
        python_version: ['3.11']

    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v4
        name: Install Python ${{ matrix.python_version }}
        with:
          python-version: ${{ matrix.python_version }}
      - name: Create empty setup.py file
        shell: bash
        run: |
              mkdir ${{ github.workspace }}/build
              touch ${{ github.workspace }}/build/setup.py
      # TODO: Test using more recent Docker image 
      - name: Get some sample wheels
        run: |
          python -m pip install cibuildwheel twine
          cibuildwheel --output-dir ${{ github.workspace }}/wheelhouse ${{ github.workspace }}/build
        env:
          CIBW_DEBUG_KEEP_CONTAINER=: TRUE
          CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28           
          CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28   
          # Skip building PyPy wheels on all platforms
          # Skip musllinux builds
          # Skip i686 builds: 32bit arch not supported in manylinux_2_28  
          CIBW_SKIP: "pp* *-musllinux* *i686"
          CIBW_BUILD_VERBOSITY: 3
          CIBW_BEFORE_ALL: >
                            cd {project} && ./.github/scripts/install_deps.sh {package}
          CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-*"
          CIBW_ENVIRONMENT: COMPILE_BINDINGS="True"
      - uses: actions/upload-artifact@v3
        with:
          name: manylinux_wheels
          path: ${{ github.workspace }}/wheelhouse

  deploy_wheels:
    name: Deploy wheels on test PyPI
    runs-on: ubuntu-latest
    needs: [build_wheels]
    if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
        name: Install Python 3.11
        with:
          python-version: '3.11'
      - uses: actions/download-artifact@v4.1.7
        with:
          name: manylinux_wheels
      - name: Upload to PyPI
        shell: bash
        run: |
          python -m pip install twine
          python -m twine upload --repository "testpypi" ${{ github.workspace }}/wheelhouse/*.whl
        env:
          TWINE_USERNAME: __token__
          TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}