CadQuery / sphinxcadquery

An extension to visualize CadQuery 3D files in your Sphinx documentation
BSD 3-Clause "New" or "Revised" License
13 stars 4 forks source link

Request for PyPi release #26

Closed shimwell closed 3 years ago

shimwell commented 3 years ago

Thanks for working through the updates for Sphinx v4.0.0, just wondering if there could be another PyPi release.

To pitch in and help I can offer a PR with a GitHub Action that would automate the package creation and uploading to PyPi

All the would be needed is a new GitHub Secret called PYPI_API_TOKEN and it can be automatically triggered on GitHub releases

# This yml file will trigger a Github Actions event that builds and upload the
# Python package to PiPy. This makes use of Twine and is triggered when a push
# to the master branch occures. For more information see:
# https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
  release:
    types: [created]

jobs:
  deploy:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python
      uses: actions/setup-python@v2
      with:
        python-version: '3.x'
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install setuptools wheel twine
    - name: Build and publish
      env:
        TWINE_USERNAME: __token__
        TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
      run: |
        python setup.py sdist bdist_wheel
        twine upload dist/*

Let me know if you think this is worth a PR

Peque commented 3 years ago

@Shimwell Thanks for your help!

Yeah, I will upload a new package version once we merge https://github.com/Peque/sphinxcadquery/issues/26. I will try to have a look at it today, when I find some time, and hopefully merge it. :blush:

I'm not sure I feel 100% comfortable uploading PyPI tokens to GitHub, so I would say there is no need to open a PR for that (I may end up not merging it :innocent: ).

Peque commented 3 years ago

@Shimwell Version 1.3.3 is available now:

https://pypi.org/project/sphinxcadquery/#history

Can you confirm it works as expected? :blush:

shimwell commented 3 years ago

Happy to confirm it is working for me https://paramak--836.org.readthedocs.build/en/836/example_neutronics_simulations.html

Many thanks

Peque commented 3 years ago

@Shimwell Thanks to you! :heart: