.github/workflows/buildwheels.yml
author robin
Thu, 30 Dec 2021 09:16:31 +0000
changeset 114 bf2e9a81f2a9
parent 112 79b0997a73b8
permissions -rw-r--r--
change buildwheels action
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
85
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
     1
# this is YAML check at http://www.yamllint.com/
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
     2
name: BuildWheels
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
     3
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
     4
on:
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
     5
  push:
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
     6
    branches:
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
     7
      - master
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
     8
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
     9
jobs:
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    10
  clear-cache:
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    11
    name: clear-cache
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    12
    runs-on: ubuntu-latest
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    13
    steps:
114
bf2e9a81f2a9 change buildwheels action
robin
parents: 112
diff changeset
    14
      - name: Dump github context
bf2e9a81f2a9 change buildwheels action
robin
parents: 112
diff changeset
    15
        run:  echo "$GITHUB_CONTEXT"
bf2e9a81f2a9 change buildwheels action
robin
parents: 112
diff changeset
    16
        shell: bash
bf2e9a81f2a9 change buildwheels action
robin
parents: 112
diff changeset
    17
        env:
bf2e9a81f2a9 change buildwheels action
robin
parents: 112
diff changeset
    18
          GITHUB_CONTEXT: ${{ toJson(github) }}
85
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    19
      - name: setup python for clear-cache
114
bf2e9a81f2a9 change buildwheels action
robin
parents: 112
diff changeset
    20
        if: github.event.repository.name == 'pyRXP-mirror'
85
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    21
        uses: actions/setup-python@v2
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    22
        with:
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    23
          python-version: 3.9
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    24
      - name: clear
114
bf2e9a81f2a9 change buildwheels action
robin
parents: 112
diff changeset
    25
        if: github.event.repository.name == 'pyRXP-mirror'
85
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    26
        env:
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    27
          CITOOLS_USER: "${{secrets.CITOOLS_USER}}"
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    28
          CITOOLS_PASSWORD: "${{secrets.CITOOLS_PASSWORD}}"
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    29
        run: |
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    30
            python -mpip install --no-cache https://hg.reportlab.com/hg-public/rl-ci-tools/archive/tip.tar.gz -U
114
bf2e9a81f2a9 change buildwheels action
robin
parents: 112
diff changeset
    31
            python -mrl_ci_tools clear-cache "pyRXP"
bf2e9a81f2a9 change buildwheels action
robin
parents: 112
diff changeset
    32
            echo "cleared remote cache for pyRXP"
85
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    33
  build-wheels-linux-mac-windows:
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    34
    needs: [clear-cache]
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    35
    name: Build wheels on ${{ matrix.os }}
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    36
    runs-on: ${{ matrix.os }}
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    37
    env:
114
bf2e9a81f2a9 change buildwheels action
robin
parents: 112
diff changeset
    38
      CIBW_SKIP: pp* *-musllinux_* cp37-macosx_arm64 *-macosx_universal2 cp36-macosx_arm64 cp36-macosx_universal2
87
beb39c22f579 remove cairo stuff
robin
parents: 85
diff changeset
    39
      #CIBW_BEFORE_BUILD_LINUX: yum install cairo-devel -y
109
c929a89bd8d6 bump cibuildwheel==2.2.0a1
robin
parents: 100
diff changeset
    40
      CIBW_BEFORE_TEST: pip install --no-cache-dir psutil
114
bf2e9a81f2a9 change buildwheels action
robin
parents: 112
diff changeset
    41
      CIBW_MANYLINUX_I686_IMAGE: manylinux2014
110
dc7ef4046ffc add new build architectures
robin
parents: 109
diff changeset
    42
      # Will avoid testing on emulated architectures
dc7ef4046ffc add new build architectures
robin
parents: 109
diff changeset
    43
      # Skip trying to test arm64 builds on Intel Macs
114
bf2e9a81f2a9 change buildwheels action
robin
parents: 112
diff changeset
    44
      CIBW_TEST_SKIP: "*-manylinux_{aarch64,ppc64le,s390x} *-musllinux_* *-macosx_arm64 *-macosx_universal2:arm64"
98
6d4500c9dfd7 fix test commands
robin
parents: 97
diff changeset
    45
      CIBW_TEST_COMMAND: python "{project}/test/runAll.py"
6d4500c9dfd7 fix test commands
robin
parents: 97
diff changeset
    46
      CIBW_TEST_COMMAND_WINDOWS: python "{project}\test\runAll.py"
85
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    47
      CIBW_BUILD_VERBOSITY: 3
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    48
    strategy:
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    49
      fail-fast: true
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    50
      matrix:
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    51
        os: [ubuntu-latest, macos-latest, windows-latest]
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    52
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    53
    steps:
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    54
      - uses: actions/checkout@v2
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    55
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    56
      # Used to host cibuildwheel
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    57
      - uses: actions/setup-python@v2
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    58
112
79b0997a73b8 fix up requirements in setup.py and add non-pypi builds; version-->3.0.0 python 3 only
robin
parents: 111
diff changeset
    59
      - name: Set up QEMU
79b0997a73b8 fix up requirements in setup.py and add non-pypi builds; version-->3.0.0 python 3 only
robin
parents: 111
diff changeset
    60
        if: runner.os == 'Linux'
79b0997a73b8 fix up requirements in setup.py and add non-pypi builds; version-->3.0.0 python 3 only
robin
parents: 111
diff changeset
    61
        uses: docker/setup-qemu-action@v1
79b0997a73b8 fix up requirements in setup.py and add non-pypi builds; version-->3.0.0 python 3 only
robin
parents: 111
diff changeset
    62
        with:
79b0997a73b8 fix up requirements in setup.py and add non-pypi builds; version-->3.0.0 python 3 only
robin
parents: 111
diff changeset
    63
          platforms: all
79b0997a73b8 fix up requirements in setup.py and add non-pypi builds; version-->3.0.0 python 3 only
robin
parents: 111
diff changeset
    64
85
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    65
      - name: Install cibuildwheel
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    66
        run: |
109
c929a89bd8d6 bump cibuildwheel==2.2.0a1
robin
parents: 100
diff changeset
    67
          python -m pip install 'cibuildwheel==2.2.0a1'
85
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    68
          python -c "import os;print('+++++ cwd=%r;dir=%r' % (os.getcwd(),os.listdir('.')))"
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    69
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    70
      - name: Build wheels
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    71
        run: python -m cibuildwheel --output-dir wheelhouse
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    72
        env:
114
bf2e9a81f2a9 change buildwheels action
robin
parents: 112
diff changeset
    73
          CIBW_ARCHS_LINUX: all #auto aarch64 #needs quemu setup
110
dc7ef4046ffc add new build architectures
robin
parents: 109
diff changeset
    74
          CIBW_ARCHS_MACOS: x86_64 arm64 universal2
85
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    75
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    76
      - name: upload wheels
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    77
        env:
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    78
          CITOOLS_USER: "${{secrets.CITOOLS_USER}}"
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    79
          CITOOLS_PASSWORD: "${{secrets.CITOOLS_PASSWORD}}"
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    80
        run: |
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    81
          python -mpip install --no-cache https://hg.reportlab.com/hg-public/rl-ci-tools/archive/tip.tar.gz -U
114
bf2e9a81f2a9 change buildwheels action
robin
parents: 112
diff changeset
    82
          python -mrl_ci_tools upload-caches --subdir="pyRXP" --verbosity=1 ./wheelhouse/*.whl
85
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    83
          python -mrl_ci_tools env-upload
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    84
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    85
      - uses: actions/upload-artifact@v2
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    86
        with:
92
0b0a17f9d877 add setup.py macro handling; fix test command and artifact name
robin
parents: 89
diff changeset
    87
          name: pyrxp-lin-win-mac
85
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    88
          path: ./wheelhouse/*.whl
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    89
  email:
114
bf2e9a81f2a9 change buildwheels action
robin
parents: 112
diff changeset
    90
    if: github.event.repository.name == 'pyRXP-mirror'
85
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    91
    name: email
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    92
    needs: [build-wheels-linux-mac-windows]
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    93
    runs-on: ubuntu-latest
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    94
    steps:
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    95
      - name: setup python for upload
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    96
        uses: actions/setup-python@v2
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    97
        with:
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    98
          python-version: 3.9
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
    99
      - name: email confirmation
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
   100
        env:
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
   101
          CITOOLS_USER: "${{secrets.CITOOLS_USER}}"
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
   102
          CITOOLS_PASSWORD: "${{secrets.CITOOLS_PASSWORD}}"
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
   103
        run: |
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
   104
            python -mpip install --no-cache https://hg.reportlab.com/hg-public/rl-ci-tools/archive/tip.tar.gz -U
114
bf2e9a81f2a9 change buildwheels action
robin
parents: 112
diff changeset
   105
            BODY="$(python -mrl_ci_tools cache-info --subdir="pyRXP" '*.whl')"
85
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
   106
            NUPLOADS=$(expr $(echo "$BODY" | wc -l) - 1)
114
bf2e9a81f2a9 change buildwheels action
robin
parents: 112
diff changeset
   107
            SUBJECT="$NUPLOADS pyRXP wheels uploaded to pypi/caches/pyRXP folder by github"
85
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
   108
            python -mrl_ci_tools email --subject="$SUBJECT" --body="$BODY"
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
   109
            echo "$SUBJECT"
75ebfe9feba5 switch to using cibuildwheel, make tests easier; version --> 2.2.2
robin
parents:
diff changeset
   110
            echo "$BODY"