diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml index a7a931e..2d73de8 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/pythonpublish.yml @@ -1,16 +1,20 @@ name: Upload Python Package on: + workflow_dispatch: release: types: [created] jobs: deploy: runs-on: ubuntu-latest + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: '3.x' - name: Install dependencies @@ -22,14 +26,10 @@ jobs: pip install -r tests/test_requirements.txt pip install . pytest - - name: Build package & publish to PyPi - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + - name: Build package run: | python setup.py sdist bdist_wheel - twine upload dist/* - - name: Deploy mkdocs site - run: | - mkdocs gh-deploy --force + # See https://docs.pypi.org/trusted-publishers/using-a-publisher/ + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/docs/contributing.md b/docs/contributing.md index 77a531e..2d7565c 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -51,3 +51,5 @@ Is in `docs/`. To [deploy the docs](https://www.mkdocs.org/user-guide/deploying- ```bash mkdocs gh-deploy ``` + +Note: there is no automated github action for this currently. \ No newline at end of file