Skip to content

Commit

Permalink
Update workflow pushing to PyPi
Browse files Browse the repository at this point in the history
Move away from using username / password login and instead use OIDC.
  • Loading branch information
mathsman5133 authored Mar 3, 2024
1 parent 8daa016 commit 66de793
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/push-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ on:

jobs:
deploy:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/coc.py
permissions:
id-token: write
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
Expand All @@ -15,10 +20,8 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
- name: Build
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 66de793

Please sign in to comment.