Skip to content

Commit

Permalink
Use PyPI trusted publishers to release
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Jul 22, 2023
1 parent 2a38250 commit 319a937
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 21 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 2 additions & 5 deletions DEVELOP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <version>, where <version> 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

0 comments on commit 319a937

Please sign in to comment.