publish2.yml 979 B

123456789101112131415161718192021222324252627282930
  1. name: PyPI Publish
  2. on: push
  3. jobs:
  4. build-n-publish:
  5. runs-on: ubuntu-latest
  6. if: startsWith(github.event.ref, 'refs/tags')
  7. steps:
  8. - uses: actions/checkout@v4
  9. - name: Set up Python 3.8
  10. uses: actions/setup-python@v5
  11. with:
  12. python-version: 3.8
  13. - name: Upgrade pip
  14. run: pip install pip --upgrade
  15. - name: Install PyTorch (cpu)
  16. run: pip install torch==1.7.0+cpu torchvision==0.8.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
  17. - name: Install dependencies
  18. run: pip install -r requirements.txt
  19. - name: Build and install
  20. run: rm -rf .eggs && pip install -e .
  21. - name: Build for distribution
  22. # remove bdist_wheel for pip installation with compiling cuda extensions
  23. run: python setup.py sdist
  24. - name: Publish distribution to PyPI
  25. uses: pypa/gh-action-pypi-publish@master
  26. with:
  27. password: ${{ secrets.PYPI_API_TOKEN }}