diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index fe16b82..3a77169 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,14 +1,22 @@ +# This workflow is used to upload and deploy a new release to PyPi +# Based on https://github.com/pypa/gh-action-pypi-publish + name: PyPi Release on: push: pull_request: + workflow_dispatch: -# based on https://github.com/pypa/gh-action-pypi-publish jobs: build: + if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' runs-on: ubuntu-latest - + environment: + name: pypi + url: https://pypi.org/p/pylammpsmpi + permissions: + id-token: write steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 @@ -25,8 +33,4 @@ jobs: run: >- python setup.py sdist bdist_wheel - name: Publish distribution 📦 to PyPI - if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.pypi_password }} + uses: pypa/gh-action-pypi-publish@release/v1