name: PyPI manylinux2014_aarch64 deployer
on:
  push:
    tags:
      - 'v*'
  workflow_dispatch:

jobs:
  # Build and deploy manylinux2014_aarch64 wheels
  Linux-build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v1
      - name: Build manylinux2014_aarch64 wheels
        uses: pypa/cibuildwheel@v2.3.1
        env:
          CIBW_BEFORE_BUILD: "pip install wheel cython"
          CIBW_ARCHS_LINUX: "aarch64"
          CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
          CIBW_BUILD: cp37-* cp38-* cp39-* cp310-*
      - name: Upload manylinux2014_aarch64 wheels to PyPI
        env:
          TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
          TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
        run: |
          ls -l ./wheelhouse
          pip install twine
          twine upload --skip-existing ./wheelhouse/*.whl
