diff --git a/.github/workflows/deploy-pipy.yaml b/.github/workflows/deploy-pipy.yaml deleted file mode 100644 index 257721f..0000000 --- a/.github/workflows/deploy-pipy.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: Publish top PyPI -on: push - -jobs: - build-n-publish: - name: Build and publish to PyPI - if: startsWith(github.ref, 'refs/tags') - runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@master - - name: Set up Python 3.7 - uses: actions/setup-python@v1 - with: - python-version: 3.7 - - name: Install - run: python -m pip install build --user - - name: Build binary wheel and a source tarball - run: python -m build --sdist --wheel --outdir dist/ . - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@master - with: - password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..60ed275 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,49 @@ +# From: https://github.com/pypa/cibuildwheel +name: Upload Python Package + +on: + push: + + release: + types: [published] + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + + steps: + - uses: actions/checkout@v2 + + # Used to host cibuildwheel + - uses: actions/setup-python@v2 + + - name: Install cibuildwheel + run: python -m pip install -U setuptools wheel pip + + - name: Build wheels + run: python setup.py sdist + + - uses: actions/upload-artifact@v2 + with: + name: dist + path: dist/*.tar.* + + release: + name: Release + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + runs-on: ubuntu-latest + needs: [ build_wheels ] + steps: + - uses: actions/download-artifact@v2 + with: + name: dist + path: dist/ + - name: Upload to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }}