Skip to content

Commit

Permalink
ci: use OIDC for pypi publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
wwade committed Mar 26, 2024
1 parent d222657 commit 5de5184
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/python-publish.yml
@@ -1,6 +1,3 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
Expand All @@ -9,9 +6,12 @@ on:

jobs:
deploy:

permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
environment:
name: pypi
url: https://pypi.org/p/shell-jobrunner
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -21,11 +21,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
pip install build
- name: Build package
run: python -m build
- name: pypi-publish
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 5de5184

Please sign in to comment.