diff --git a/.github/workflows/pypi_wheel.yml b/.github/workflows/pypi_wheel.yml deleted file mode 100644 index e2ffe0f..0000000 --- a/.github/workflows/pypi_wheel.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Python package build and publish - -on: - release: - types: [created] - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: 3.8 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install twine flake8 - - name: Lint with flake8 for syntax errors - run: | - pip install flake8 - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Build manylinux Python wheels - uses: RalfG/python-wheels-manylinux-build@v0.3.1-manylinux2010_x86_64 - with: - python-versions: 'cp36-cp36m cp37-cp37m' - build-requirements: 'numpy' - - name: Publish wheels to PyPI - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} - run: | - twine upload dist/*.whl diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 40dcf94..daf8cc0 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -7,12 +7,12 @@ on: branches: [ master ] jobs: + build: runs-on: ubuntu-latest strategy: matrix: python-version: ["3.6", "3.7", "3.8", "3.9"] - steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -25,21 +25,22 @@ jobs: run: make lint - name: Test with pytest run: make test + dist: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Setup venv - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + if: github.event_name == 'release' && github.event.action == 'created' uses: actions/setup-python@v2 with: python-version: "3.9" - run: make venv - name: Build package - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + if: github.event_name == 'release' && github.event.action == 'created' run: make build - name: Publish package - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + if: github.event_name == 'release' && github.event.action == 'created' uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__