name: Build & Publish wheel

on: push

jobs:
  build:

    strategy:
      # Allows for matrix sub-jobs to fail without canceling the rest
      fail-fast: false

      matrix:
        env: [{TARGET: wheel_manylinux2010_x86_64}, {TARGET: wheel_manylinux2010_i686}, {TARGET: wheel_manylinux2014_aarch64}]

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Set up Python 3.8
      uses: actions/setup-python@v2
      with:
        python-version: 3.8

    - name: Install Dependency
      run: |
        pip install cython

    - name: Building wheel
      run: |
        make sdist ${{ matrix.env.TARGET }}

    - name: Copy wheels in dist
      run: cp wheelhouse*/fastrlock*.whl dist/

    - name: Archive Wheels
      uses: actions/upload-artifact@v2
      with:
        name: ${{ matrix.env.TARGET }}
        path: dist/*manylinux*.whl
        if-no-files-found: ignore

    - name: Push build artifacts to PyPI
      if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
      uses: pypa/gh-action-pypi-publish@v1.4.2
      with:
        skip_existing: true
        user: __token__
        password: ${{ secrets.PYPI_API_TOKEN }}

name: Build & Publish wheel

on: push

jobs:
  build:

    strategy:
      # Allows for matrix sub-jobs to fail without canceling the rest
      fail-fast: false

      matrix:
        env: [{TARGET: wheel_manylinux2010_x86_64}, {TARGET: wheel_manylinux2010_i686}, {TARGET: wheel_manylinux2014_aarch64}]

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Set up Python 3.8
      uses: actions/setup-python@v2
      with:
        python-version: 3.8

    - name: Install Dependency
      run: |
        pip install cython

    - name: Building wheel
      run: |
        make sdist ${{ matrix.env.TARGET }}

    - name: Copy wheels in dist
      run: cp wheelhouse*/fastrlock*.whl dist/

    - name: Release
      uses: softprops/action-gh-release@v1
      if: startsWith(github.ref, 'refs/tags/')
      with:
        files: dist/*manylinux*.whl

    - name: Archive Wheels
      uses: actions/upload-artifact@v2
      with:
        name: ${{ matrix.env.TARGET }}
        path: dist/*manylinux*.whl
        if-no-files-found: ignore

Use GH Releases upload instead of PyPI upload.
Use GH Releases upload instead of PyPI upload.
