diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18be64d..3bb520a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,19 +41,3 @@ jobs: run: | python -m tox - uses: codecov/codecov-action@v1 - deploy: - runs-on: ubuntu-latest - needs: - - pre-commit - - tests - if: startsWith(github.ref, 'refs/tags') - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - - name: Build a binary wheel and a source tarball - run: pipx run build - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.pypi_token }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ae06a3f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +on: + release: + types: + - published + +name: release + +jobs: + pypi: + name: upload release to PyPI + runs-on: ubuntu-latest + environment: release + + permissions: + # Used to authenticate to PyPI via OIDC. + id-token: write + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-python@v4 + with: + python-version: ">= 3.7" + + - name: build + run: pipx run build + + - name: publish + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/DEVELOP.rst b/DEVELOP.rst index 32f6310..73f5b3b 100644 --- a/DEVELOP.rst +++ b/DEVELOP.rst @@ -13,8 +13,5 @@ How to release * python setup.py check --restructuredtext * commit everything * make sure tests pass! -* git push and make sure travis is green -* git tag , where is PEP 440 compliant -* git push --tags - -Uploading of tagged versions to pypi will be taken care of by travis. +* git push and make sure CI is green +* create a tagged release on GitHub, which will trigger deployment to PyPI