Skip to content

Commit

Permalink
Update authentication to OIDC for pypi uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
sblack-usu authored Feb 19, 2024
1 parent 6e3ad7b commit 4800e51
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,26 @@ on:
types: [created]

jobs:
deploy:

pypi-publish:
name: upload release to PyPI
runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/p/hsclient
# Specifying a GitHub environment is optional, but strongly encouraged
# environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
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 Distribution
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
python -m pip install --upgrade build
python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 4800e51

Please sign in to comment.