Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

PoC: build multi-OS Python (#1017)

Jirka Borovecc3238de3fcc0
diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml
index 669d8df7e..c6c587f4e 100644
--- a/.github/workflows/pypi-release.yml
+++ b/.github/workflows/pypi-release.yml
@@ -7,29 +7,94 @@ on: # Trigger the workflow on push or pull request, but only for the master bra
release:
types: [published]
-
jobs:
- # based on https://github.com/pypa/gh-action-pypi-publish
- build-publish:
+ build-sdist:
runs-on: ubuntu-20.04
-
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@master
- uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
- run: >-
- python -m pip install --user --upgrade setuptools wheel
- - name: Build
+ run: python -m pip install --user --upgrade setuptools wheel
+ - name: Build source
+ env:
+ KORNIA_RELEASE: 1
run: |
- KORNIA_RELEASE=1 python setup.py sdist bdist_wheel
+ python setup.py sdist bdist_wheel
ls -lh dist/
- - name: Publish distribution πŸ“¦ to PyPI
+ - uses: actions/upload-artifact@v2
+ with:
+ name: pypi-packages-${{ github.sha }}
+ path: dist
+
+ #build-wheels:
+ # runs-on: ${{ matrix.os }}
+ # needs: build-sdist
+ # strategy:
+ # fail-fast: true
+ # max-parallel: 1
+ # matrix:
+ # os: [ubuntu-20.04, macOS-10.15, windows-2019]
+ # #python-version: [2.7, 3.6, 3.7, 3.8, 3.9]
+ # steps:
+ # - uses: actions/checkout@master
+ # - uses: actions/download-artifact@v2
+ # with:
+ # name: pypi-packages-${{ github.sha }}
+ # path: dist
+ #
+ # - name: Building wheels
+ # uses: pypa/[email protected]
+ # env:
+ # KORNIA_RELEASE: 1
+ # # Disable building PyPy wheels on all platforms
+ # CIBW_SKIP: cp27-* cp35-* pp*
+ # with:
+ # output-dir: dist
+ #
+ # - uses: actions/upload-artifact@v2
+ # with:
+ # name: pypi-packages-${{ github.sha }}
+ # path: dist
+
+ upload-packages:
+ runs-on: ubuntu-20.04
+ needs: build-sdist
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/download-artifact@v2
+ with:
+ name: pypi-packages-${{ github.sha }}
+ path: dist
+ - run: ls -lh dist/
+
+ - name: Upload to release
+ uses: AButler/[email protected]
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
- uses: pypa/gh-action-pypi-publish@master
+ with:
+ files: 'dist/*'
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
+
+ publish-pypi:
+ runs-on: ubuntu-20.04
+ needs: build-sdist
+ if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
+ steps:
+ - uses: actions/checkout@master
+ - uses: actions/setup-python@v2
+ with:
+ python-version: 3.7
+ - uses: actions/download-artifact@v2
+ with:
+ name: pypi-packages-${{ github.sha }}
+ path: dist
+ - run: ls -l dist/
+
+ - name: Publish distribution πŸ“¦ to PyPI
+ uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_password }}