alan-turing-institute / netts

Toolbox for creating networks capturing semantic content of speech transcripts.
https://alan-turing-institute.github.io/netts/
GNU General Public License v3.0
8 stars 1 forks source link

Should automatically publish to PyPI on release #135

Open Iain-S opened 3 years ago

Iain-S commented 3 years ago

It would be nice if GitHub could automatically publish netts when a new GitHub release is created.

Iain-S commented 3 years ago

Roughly, we would want to add a github workflow that looks something like

name: Publish package
on:
  release:
    types: [published]
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
         uses: actions/setup-python@v1
         with:
           python-version: ${{ matrix.python-version }}

      - name: Bootstrap poetry
        shell: bash
        run: |
          python -m ensurepip
          python -m pip install --upgrade pip
          python -m pip install poetry
          python -m poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}.  # need to add this to repo
          python -m poetry publish --build

or we could use https://github.com/marketplace/actions/publish-python-poetry-package.

Also, see https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/