ci: Configure upload to pypi
@@ -27,17 +27,13 @@ jobs:
- name: Test with tox
run: tox
- - name: Build with bdist wheel
- run: |
- pip install cython numpy setuptools wheel
- python setup.py bdist_wheel
+ - name: Build wheels
+ uses: pypa/cibuildwheel@v2.1.1
- - name: Archive production artifacts
- uses: actions/upload-artifact@v2
+ - uses: actions/upload-artifact@v2
with:
name: dist
- path: |
- dist
+ path: ./wheelhouse/*.whl
build-sdist:
runs-on: ubuntu-latest
@@ -64,7 +60,20 @@ jobs:
release:
needs: ["build-sdist", "build"]
runs-on: ubuntu-latest
+ environment: PYPI_PASSWORD
+ # if: github.ref == 'refs/heads/fix-ci'
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
+ - run: echo "Deploying to pypi on branch $GITHUB_REF"
+
- name: Download all workflow run artifacts
uses: actions/download-artifact@v2
+
- run: ls dist
+
+ - name: Publish package
+ uses: pypa/gh-action-pypi-publish@release/v1
+ with:
+ user: __token__
+ password: ${{ secrets.PYPI_TOKEN }}
+ skip_existing: true
